@zeniai/web-components 4.2.26 → 4.2.28
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/{SessionTimeoutPopup-DMOkSnof.cjs → SessionTimeoutPopup-FQidz3x6.cjs} +18211 -16480
- package/dist/{SessionTimeoutPopup-BXdAFUpR.js → SessionTimeoutPopup-nM8Th-1x.js} +97035 -91828
- package/dist/appLocale.d.ts +95 -3
- package/dist/cockpit.cjs.js +69 -69
- package/dist/cockpit.esm.js +2158 -2164
- package/dist/components/aiCfo/AiCfoPage.d.ts +8 -1
- package/dist/components/aiCfo/components/AiCfoInput.d.ts +7 -0
- package/dist/components/aiCfo/components/AiCfoSkillMenu.d.ts +19 -0
- package/dist/components/aiCfo/components/helpers/aiCfoSlashHelpers.d.ts +30 -0
- package/dist/components/aiCfo/stories/components/AiCfoStoryWrapper.d.ts +6 -1
- package/dist/components/aiCfo/stories/hooks/useAiCfoStoryState.d.ts +2 -2
- package/dist/components/common/uploadInvoice/RenderPdf.d.ts +14 -0
- package/dist/components/expenseAutomation/ExpenseAutomationPage.d.ts +1 -0
- package/dist/components/expenseAutomation/components/TableSection.d.ts +1 -0
- package/dist/components/expenseAutomation/sections/accountRecon/AccountReconDetailsDrawerPageV2.d.ts +44 -0
- package/dist/components/expenseAutomation/sections/accountRecon/AccountReconListSkeleton.d.ts +3 -1
- package/dist/components/expenseAutomation/sections/accountRecon/AccountReconciliationListPage.d.ts +2 -1
- package/dist/components/expenseAutomation/sections/accountRecon/AccountReconciliationPage.d.ts +2 -1
- package/dist/components/expenseAutomation/sections/accountRecon/ExcludedAccountReconDetailsDrawerPage.d.ts +3 -1
- package/dist/components/expenseAutomation/sections/accountRecon/ReconciliationProgressBar.d.ts +10 -0
- package/dist/components/expenseAutomation/sections/accountRecon/ReconciliationStatsCards.d.ts +5 -0
- package/dist/components/expenseAutomation/sections/accountRecon/StatementDateConflictPopup.d.ts +8 -0
- package/dist/components/expenseAutomation/sections/accountRecon/StatementPageLayout.d.ts +18 -0
- package/dist/components/expenseAutomation/sections/accountRecon/StatementParseInfo.d.ts +14 -0
- package/dist/components/expenseAutomation/sections/accountRecon/StatementProcessingPage.d.ts +10 -0
- package/dist/components/expenseAutomation/sections/accountRecon/mapAccountReconToReportTreeNodesV2.d.ts +16 -0
- package/dist/components/expenseAutomation/sections/accountRecon/mapExcludedAccountReconToReportTreeNodes.d.ts +2 -0
- package/dist/components/reportTree/reportTreeTypes.d.ts +1 -0
- package/dist/components/reportTree/treeNode/accountReconReport/row/AccountRow.d.ts +12 -0
- package/dist/components/reportTree/treeNode/accountReconReport/row/v2/AccountRow.d.ts +59 -0
- package/dist/components/reportTree/treeNode/accountReconReport/row/v2/LoadingInProgressRow.d.ts +3 -0
- package/dist/components/reportTree/treeNode/accountReconReport/row/v2/SectionRow.d.ts +10 -0
- package/dist/components/reportTree/treeNode/accountReconReport/row/v2/TimeframeRow.d.ts +7 -0
- package/dist/components/reportTree/treeNode/accountReconReport/row/v2/TotalRow.d.ts +15 -0
- package/dist/components/reportTree/treeNode/accountReconReport/row/v2/common.d.ts +38 -0
- package/dist/components/reportTree/treeNode/accountReconReport/row/v2/rowConstructors.d.ts +6 -0
- package/dist/components/reportTree/treeNode/accountReconReport/row/v2/statusHelper.d.ts +12 -0
- package/dist/components/reportTree/treeNode/accountReconReport/treeNodeMappers/v2/mapSectionToTreeNode.d.ts +11 -0
- package/dist/components/reportTree/treeNode/getTreeNodeData.d.ts +1 -1
- package/dist/context/SidePanelContext.d.ts +1 -1
- package/dist/context/featureProvider/FeatureGateNameConstants.d.ts +3 -1
- package/dist/designSystem/zeniColors.d.ts +8 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.esm.js +334 -331
- package/dist/strings/strings.d.ts +95 -3
- package/package.json +7 -7
package/dist/cockpit.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./SessionTimeoutPopup-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./SessionTimeoutPopup-FQidz3x6.cjs"),o=require("./vendor-.pnpm-XfeS4-Fh.cjs"),u=require("react"),s=require("@emotion/styled"),Xe=require("@liveblocks/react"),J=require("@zeniai/client-epic-state"),Es=require("@liveblocks/react-ui"),we=require("@emotion/react"),Lo=require("react-dom"),St=require("@liveblocks/react-ui/primitives"),xi=require("@liveblocks/react/suspense");function wa(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const le=wa(u),va=({inboxNotification:e,onNotificationClick:n})=>{const r=Xe.useInboxNotificationThread(e.id),i=r.metadata.entityType.split("."),a=r.metadata.isGlobalComment&&i.length===2;return o.jsxRuntimeExports.jsx(ka,{isClickable:a,isUnRead:e.readAt==null,onClick:()=>{n(r.metadata,r.id)},children:o.jsxRuntimeExports.jsx(Es.InboxNotification,{inboxNotification:e,kinds:{thread:d=>o.jsxRuntimeExports.jsx(Es.InboxNotification.Thread,{...d,showRoomName:!0})}})})},ka=s.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
width: 100%;
|
|
4
4
|
cursor: ${e=>e.isClickable?"pointer":"initial"};
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
&:hover {
|
|
15
15
|
border: 1px solid ${e=>e.theme.colors.grey1};
|
|
16
16
|
}
|
|
17
|
-
`,{common:{headers:{notifications:Ta}},commentsAndNotifications:{notifications:{texts:La}},timeFormat:{hmmADashDDMMMCommaYYYY:ws}}=t.appLocale.getLocalizedStrings(),Pa=e=>{const{inboxNotifications:n,isLoading:r,isFetchingMore:i,hasFetchedAll:a,fetchMore:d}=Xe.useInboxNotifications();u.useEffect(()=>{const
|
|
17
|
+
`,{common:{headers:{notifications:Ta}},commentsAndNotifications:{notifications:{texts:La}},timeFormat:{hmmADashDDMMMCommaYYYY:ws}}=t.appLocale.getLocalizedStrings(),Pa=e=>{const{inboxNotifications:n,isLoading:r,isFetchingMore:i,hasFetchedAll:a,fetchMore:d}=Xe.useInboxNotifications();u.useEffect(()=>{const S=setTimeout(()=>d?.(),0);return()=>clearTimeout(S)});const l=r||i===!0||a!==!0,c=Xe.useMarkInboxNotificationAsRead(),[p,m]=u.useState(!1),{isDrawerOpen:x,application:g,onNotificationClick:h,onCloseAllInboxNotificationsDrawer:j}=e,b=u.useMemo(()=>{if(!n)return[];const S=[...n];return S.sort((y,f)=>{const E=J.zeniDate(y.notifiedAt.toDateString(),ws),R=J.zeniDate(f.notifiedAt.toDateString(),ws);return E.isSame(R,"day")?0:E.isSameOrBefore(R,"day")?-1:1}),S.filter(y=>y.roomId?.includes(g)===!0)},[g,n]),C=u.useCallback(()=>{m(!0);const S=b.filter(y=>y.readAt==null);S.length===0?m(!1):S.forEach((y,f)=>{c(y.id),f===S.length-1&&setTimeout(()=>{m(!1)},1e3)})},[c,b]);return o.jsxRuntimeExports.jsx(o.Drawer,{anchor:"right",open:x,style:{display:"flex",justifyContent:"space-between"},onClose:j,transitionDuration:250,children:o.jsxRuntimeExports.jsx(Ia,{children:o.jsxRuntimeExports.jsxs(Aa,{children:[o.jsxRuntimeExports.jsxs(za,{children:[o.jsxRuntimeExports.jsx(Ba,{}),o.jsxRuntimeExports.jsx(Wa,{onClick:j,children:o.jsxRuntimeExports.jsx(Va,{})})]}),o.jsxRuntimeExports.jsxs(Da,{children:[o.jsxRuntimeExports.jsxs(Fa,{children:[o.jsxRuntimeExports.jsx(_a,{children:Ta}),o.jsxRuntimeExports.jsx(Oa,{variant:"ghost",size:"small",label:La.markAllAsRead,onClick:C,prefixIcon:l||p?o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Small",start:!0}):o.jsxRuntimeExports.jsx(Na,{className:"mark-as-read"}),disabled:l||p,textStyle:{...t.textStyles.standardRegular.cssObject},style:{borderRadius:t.Space.sp1,border:"none",backgroundColor:"transparent",flexShrink:0,padding:t.Space.sp0,cursor:l||p?"default":"pointer"}})]}),r===!0?o.jsxRuntimeExports.jsx(Ua,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Standard",style:{color:"inherit"},start:!0})}):o.jsxRuntimeExports.jsx(Ma,{children:b.map(S=>o.jsxRuntimeExports.jsx(va,{inboxNotification:S,onNotificationClick:(y,f)=>h(y,f)},S.id))})]})]})})})},Ia=s.div`
|
|
18
18
|
height: 100%; // Drawer header height
|
|
19
19
|
`,Aa=s.div`
|
|
20
20
|
width: 400px;
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
height: ${t.Space.sp3};
|
|
191
191
|
align-items: center;
|
|
192
192
|
justify-content: center;
|
|
193
|
-
`,$l=s.div``,{cockpit:yn,common:El}=t.appLocale.getLocalizedStrings();function wl({defaultOptions:e,downloadState:n,downloadParams:r,signedInUser:i,cockpitHeader:a,analytics:d,currentTab:l,updateDownloadStateHandler:c,onZeniLogoClick:p,onLogOutClick:m,onThreadClick:x,onNotificationClick:
|
|
193
|
+
`,$l=s.div``,{cockpit:yn,common:El}=t.appLocale.getLocalizedStrings();function wl({defaultOptions:e,downloadState:n,downloadParams:r,signedInUser:i,cockpitHeader:a,analytics:d,currentTab:l,updateDownloadStateHandler:c,onZeniLogoClick:p,onLogOutClick:m,onThreadClick:x,onNotificationClick:g,onNewCustomerClick:h}){const j=t.useWindowSizeContext(),[b,C]=u.useState(!1),[S,y]=u.useState(!1),{inboxNotifications:f,isLoading:E,isFetchingMore:R,hasFetchedAll:I,fetchMore:A}=Xe.useInboxNotifications(),{threads:v,isLoading:T}=t.useFilteredThreads({application:"cockpit",isGlobalComment:!0},"both",!0),D=u.useMemo(()=>v.filter(O=>O.resolved===!1),[v]).length,{setOpenThread:K,setRequestToOpenThread:M,openThread:Y}=u.useContext(t.ThreadsContext);u.useEffect(()=>{const O=setTimeout(()=>A?.(),0);return()=>clearTimeout(O)});const G=E||R===!0||I!==!0,w=f?.filter(O=>O.readAt==null&&O.roomId?.includes("cockpit")===!0).length,P=pl(l),B=u.useCallback((O,z)=>{const{companyId:Z,entityType:ie}=O;Y===z?K(null):(C(!1),M({threadId:z,companyId:Z,entityType:ie}))},[Y,K,M]),k=u.useCallback((O,z)=>{const{companyId:Z,entityType:ie}=O;Y===z?K(null):(y(!1),M({threadId:z,companyId:Z,entityType:ie}))},[Y,K,M]);return j!=="small"?o.jsxRuntimeExports.jsxs(vs,{children:[o.jsxRuntimeExports.jsxs(ks,{children:[o.jsxRuntimeExports.jsx(Cl,{children:o.jsxRuntimeExports.jsx(fl,{"data-testid":t.generateDataTestId("zeni-logo-cockpit-nav-bar"),onClick:p})}),o.jsxRuntimeExports.jsx(Sl,{children:a??yn.cockpitHeader}),o.jsxRuntimeExports.jsxs(jl,{children:[b?null:o.jsxRuntimeExports.jsxs(Ts,{isDisabled:T,onClick:T?()=>null:()=>C(!0),children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:T?void 0:D,isLoading:T,style:{left:"12px"}}),o.jsxRuntimeExports.jsx(bl,{})]}),o.jsxRuntimeExports.jsxs(Ts,{isDisabled:G,onClick:G?()=>null:()=>y(!0),children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:w,isLoading:G,style:{left:"12px"}}),o.jsxRuntimeExports.jsx(Rl,{})]}),o.jsxRuntimeExports.jsx(hl,{defaultOptions:e,downloadParams:r,downloadState:n,analytics:d,currentCockpitTab:P,updateDownloadStateHandler:c}),o.jsxRuntimeExports.jsx(t.Button,{variant:"primary",size:"small",style:{whiteSpace:"nowrap"},label:yn.newCustomer,onClick:h}),o.jsxRuntimeExports.jsx(yl,{children:o.jsxRuntimeExports.jsx(t.LogoutButton,{signedInUser:i,pageName:"Cockpit",onLogOutClick:m})})]})]}),o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:b,filter:{application:"cockpit",isGlobalComment:!0},autoExpand:!0,autoFocus:!1,drawerTitle:El.headers.comments,onCloseAllThreadsDrawer:()=>C(!1),onThreadClick:(O,z)=>{x(O,z,B)},style:{cursor:"pointer"},showReactions:!0,showActions:!0,allowExpand:!0,threads:v,isLoading:T,allowComposer:!1,textOverrides:{},withRoomProvider:!0}),o.jsxRuntimeExports.jsx(Pa,{application:"cockpit",isDrawerOpen:S,onNotificationClick:(O,z)=>{g(O,z,k)},onCloseAllInboxNotificationsDrawer:()=>y(!1)})]}):o.jsxRuntimeExports.jsx(vs,{className:"mobileHeader",children:o.jsxRuntimeExports.jsxs(ks,{className:"mobileTitle",children:[o.jsxRuntimeExports.jsx(t.Button,{variant:"primary",size:"small",style:{whiteSpace:"nowrap"},label:yn.newCustomer,onClick:h}),o.jsxRuntimeExports.jsx($l,{children:o.jsxRuntimeExports.jsx(t.LogoutButton,{signedInUser:i,pageName:"Cockpit",onLogOutClick:m})})]})})}const gs=["management","subscription","portfolio","onboarding","audit","healthMonitor","taskManager","aiAccountant","creditAgent"],Rt=e=>J.stringToUnion(e,gs),vl=e=>J.stringToUnionStrict(e,gs),kl=(e,n)=>e in n,bi=e=>{switch(e){case"management":return hi;case"subscription":return gi;case"portfolio":return Si;case"healthMonitor":return yi;case"aiAccountant":return ml;case"taskManager":return ji;default:return[]}},rs=(e,n)=>{const{cockpit:{filters:{filterCategories:r}}}=t.appLocale.getLocalizedStrings();switch(e){case"management":return r.management[n];case"portfolio":return r.portfolio[n];case"subscription":return r.subscription[n];case"aiAccountant":return r.aiAccountant[n];case"taskManager":return r.taskManager[n];default:return r.healthMonitor[n]}},Tl=s.div`
|
|
194
194
|
display: flex;
|
|
195
195
|
justify-content: space-between;
|
|
196
196
|
align-items: center;
|
|
@@ -198,7 +198,7 @@
|
|
|
198
198
|
color: ${e=>e.theme.colors.primary};
|
|
199
199
|
width: ${t.Space.sp4};
|
|
200
200
|
height: ${t.Space.sp4};
|
|
201
|
-
`,Ls=({onChange:e,value:n,categoryIndex:r,defaultMenuIsOpen:i=!1,selectedCockpitOption:a})=>{const d=o.useTheme(),l=u.useRef(null),c=t.getDropdownStyles(d),p=bi(a),m=p.find(h=>h.value===n);u.useEffect(()=>{const h=setTimeout(()=>{l.current!=null&&i&&l.current.focus()},300);return()=>{clearTimeout(h)}},[i]);const x=h=>{const
|
|
201
|
+
`,Ls=({onChange:e,value:n,categoryIndex:r,defaultMenuIsOpen:i=!1,selectedCockpitOption:a})=>{const d=o.useTheme(),l=u.useRef(null),c=t.getDropdownStyles(d),p=bi(a),m=p.find(h=>h.value===n);u.useEffect(()=>{const h=setTimeout(()=>{l.current!=null&&i&&l.current.focus()},300);return()=>{clearTimeout(h)}},[i]);const x=h=>{const j=rs(a,h.data.value);return o.jsxRuntimeExports.jsx(o.components.SingleValue,{...h,children:o.jsxRuntimeExports.jsx(t.StandardRegularSp,{children:j})})},g=h=>{const{isSelected:j}=h,b=rs(a,h.data.value);return o.jsxRuntimeExports.jsx(o.components.Option,{...h,children:o.jsxRuntimeExports.jsxs(Tl,{"data-testid":t.generateDataTestId("cockpit-filters-category-option",typeof h.data.value=="string"?h.data.value:h.data.value?.code??h.data.value?.id??h.label),children:[o.jsxRuntimeExports.jsx(t.StandardRegular,{children:b}),j&&o.jsxRuntimeExports.jsx(Ll,{})]})})};return o.jsxRuntimeExports.jsx(Pl,{"data-testid":t.generateDataTestId("cockpit-filters-category-select"),children:o.jsxRuntimeExports.jsx(o.StateManagedSelect$1,{ref:l,isMulti:!1,value:m,onChange:h=>{e(h,r)},placeholder:t.appLocale.getLocalizedStrings().cockpit.filters.categoryPlaceholder,options:p,styles:c,menuPosition:"fixed",openMenuOnFocus:!0,components:{Option:g,SingleValue:x}})})},Pl=s.div``,Il=({selectedRanges:e,options:n,onNumericRangeChange:r})=>{const i=t.useWindowSizeContext(),a=o.useTheme(),d=e.start,l=e.end,[c,p]=u.useState(d),[m,x]=u.useState(l),[g,h]=u.useState(n);u.useEffect(()=>{c!=null&&m!=null&&(r({start:c,end:m}),c>m&&x(c)),c!=null?h(n.filter(S=>S>=c)):h(n)},[c,m]);const j=S=>{p(S)},b=S=>{x(S)},C=t.appLocale.getLocalizedStrings().spendManagement.filters;return o.jsxRuntimeExports.jsxs(Al,{size:i,children:[o.jsxRuntimeExports.jsx(Ps,{children:o.jsxRuntimeExports.jsx(t.SingleSelectNumeric,{onSelectedValueChanged:j,placeholder:C.from,defaultValue:{allOptions:n,selectedOption:c},hasError:!1,customStyleConfig:{input:()=>({input:{textAlign:"left"}}),control:()=>({backgroundColor:a.colors.background})}})}),o.jsxRuntimeExports.jsx(Dl,{children:C.enDash}),o.jsxRuntimeExports.jsx(Ps,{children:o.jsxRuntimeExports.jsx(t.SingleSelectNumeric,{onSelectedValueChanged:b,placeholder:C.to,defaultValue:{allOptions:g,selectedOption:m},hasError:!1,customStyleConfig:{input:()=>({input:{textAlign:"left"}}),control:()=>({backgroundColor:a.colors.background})}})})]})},Al=s.div`
|
|
202
202
|
display: flex;
|
|
203
203
|
align-items: center;
|
|
204
204
|
column-gap: ${t.Space.sp3};
|
|
@@ -262,7 +262,7 @@
|
|
|
262
262
|
`,Gl=s(t.StandardRegularSp)`
|
|
263
263
|
overflow: hidden;
|
|
264
264
|
text-overflow: ellipsis;
|
|
265
|
-
`,Yl=({options:e,categoryIndex:n,value:r,categoryType:i,categoryLabel:a,valuesCombinationOperator:d,showAnyAll:l,onChange:c,onValuesCombinationOperatorChange:p})=>{const m=o.useTheme(),x=t.getMultiSelectDropdownStyles(m),{common:{filters:
|
|
265
|
+
`,Yl=({options:e,categoryIndex:n,value:r,categoryType:i,categoryLabel:a,valuesCombinationOperator:d,showAnyAll:l,onChange:c,onValuesCombinationOperatorChange:p})=>{const m=o.useTheme(),x=t.getMultiSelectDropdownStyles(m),{common:{filters:g,texts:h},cockpit:{userProfileAltText:j}}=t.appLocale.getLocalizedStrings(),b=r.map(T=>e.find(F=>F.value===T)),C=(T,F,D,K)=>i!=="user"?null:T==null?o.jsxRuntimeExports.jsx(t.EntityAvatarWithInitials,{firstName:F,lastName:D,index:K}):o.jsxRuntimeExports.jsx(Vl,{src:T.href,alt:j,onError:({currentTarget:M})=>{M.onerror=null,M.src=t.AvatarSVG},loading:"lazy"}),S=T=>i!=="rating"?null:Object.keys(eo).includes(T)?o.jsxRuntimeExports.jsx(ln,{iconName:eo[T].iconName,width:18,height:18,stopAnimation:!0,style:{margin:0}}):o.jsxRuntimeExports.jsx(ln,{iconName:To[T].iconName,stopAnimation:!0,width:18,height:18,style:{margin:0}}),y=T=>i!=="runway"?null:o.jsxRuntimeExports.jsx(Ml,{color:T}),f=T=>{const F=e.findIndex(D=>D.value===T.data.value);return o.jsxRuntimeExports.jsx(o.components.MultiValueLabel,{...T,children:o.jsxRuntimeExports.jsxs(Bl,{children:[C(T.data.photo,T.data.label.split(" ")[0],T.data.label.split(" ")[1]!=null?T.data.label.split(" ")[1]:"",F),S(T.data.value),y(T.data.iconColor),o.jsxRuntimeExports.jsx(Gl,{children:T.children})]})})},E=T=>o.jsxRuntimeExports.jsx(o.components.MultiValueRemove,{...T,children:o.jsxRuntimeExports.jsx(Kl,{})}),R=T=>{const{onMouseMove:F,onMouseOver:D,isSelected:K,...M}=T.innerProps,Y=e.findIndex(w=>w.value===T.data.value),G={...T,innerProps:M};return o.jsxRuntimeExports.jsx(o.components.Option,{...G,children:o.jsxRuntimeExports.jsxs(Wl,{children:[o.jsxRuntimeExports.jsxs(_l,{children:[C(T.data.photo,T.data.label.split(" ")[0],T.data.label.split(" ")[1]!=null?T.data.label.split(" ")[1]:"",Y),S(T.data.value),y(T.data.iconColor),o.jsxRuntimeExports.jsx(t.StandardRegular,{children:T.label})]}),T.isSelected&&o.jsxRuntimeExports.jsx(Ul,{})]})})},I=(T,F)=>i==="user"&&T.data.email!=null?T.data.label.toLowerCase().includes(F.toLowerCase())||T.data.email.toLowerCase().includes(F.toLowerCase()):T.data.label.toLowerCase().includes(F.toLowerCase()),A=l&&b.length>1,v=()=>{switch(i){case"dateRange":return o.jsxRuntimeExports.jsx(Xl,{"data-testid":t.generateDataTestId("cockpit-filters-values-daterange"),children:o.jsxRuntimeExports.jsx(t.DateRangeFilterField,{onDateRangeChange:T=>{T.startDate!=null&&T.endDate!=null&&c([{label:g.startDate,value:T.startDate},{label:g.endDate,value:T.endDate}],n)},selectedDates:r})});case"dropdownRange":return o.jsxRuntimeExports.jsx(ql,{"data-testid":t.generateDataTestId("cockpit-filters-values-numrange"),children:o.jsxRuntimeExports.jsx(Il,{options:e.map(T=>parseInt(T.label)),onNumericRangeChange:T=>{T.start!=null&&T.end!=null&&c([{label:g.startDate,value:T.start.toString()},{label:g.endDate,value:T.end.toString()}],n)},selectedRanges:r!=null&&r.length>0?{start:parseInt(r[0].toString()),end:parseInt(r[1].toString())}:{start:void 0,end:void 0}})});default:return o.jsxRuntimeExports.jsxs(Fl,{"data-testid":t.generateDataTestId("cockpit-filters-values-select-container"),children:[b.length===0&&i==="user"?o.jsxRuntimeExports.jsx(Hl,{}):null,o.jsxRuntimeExports.jsx(o.StateManagedSelect$1,{isMulti:!0,hideSelectedOptions:!1,value:b,onChange:T=>{Array.isArray(T)===!0&&c(T,n)},placeholder:`${h.select} ${a}`,options:e,styles:x,menuPosition:"fixed",components:{Option:R,MultiValueLabel:f,MultiValueRemove:E},filterOption:I})]})}};return o.jsxRuntimeExports.jsxs(zl,{categoryType:i,"data-testid":t.generateDataTestId("cockpit-filters-values-wrapper"),children:[v(),A&&o.jsxRuntimeExports.jsx(Zl,{"data-testid":t.generateDataTestId("cockpit-filters-values-any-all"),children:o.jsxRuntimeExports.jsx(Ol,{categoryIndex:n,value:d,onChange:p})})]})},Zl=s.div``,Xl=s.div``,ql=s.div``,As=s.div`
|
|
266
266
|
display: flex;
|
|
267
267
|
flex-direction: column;
|
|
268
268
|
row-gap: ${t.Space.sp4};
|
|
@@ -350,14 +350,14 @@
|
|
|
350
350
|
align-items: flex-start;
|
|
351
351
|
column-gap: ${t.Space.sp3};
|
|
352
352
|
animation: ${ic} 0.4s;
|
|
353
|
-
`,Ri=u.forwardRef(({filters:e,onFiltersChange:n,filterValues:r,selectedCockpitOption:i},a)=>{const d=u.useCallback((
|
|
353
|
+
`,Ri=u.forwardRef(({filters:e,onFiltersChange:n,filterValues:r,selectedCockpitOption:i},a)=>{const d=u.useCallback((C,S)=>{const y=t.getUpdatedFiltersOnCategoryChange({currentFilters:e,selectedOption:C,categoryIndex:S});n(y)},[e,n]),l=u.useCallback((C,S)=>{const y=t.getUpdatedFiltersOnMatchingOperatorChange({currentFilters:e,selectedOption:C,categoryIndex:S});n(y)},[e,n]),c=u.useCallback((C,S)=>{if(e.categories==null)return;const y={...e,categories:e.categories.map((f,E)=>E!=S?f:{...f,valuesCombinationOperator:C.value})};n(y)},[e,n]),p=u.useCallback(C=>{if(e!=null){const S={...e,categoryCombinationOperator:C};n(S)}},[e,n]),m=u.useCallback(C=>{if(C===0&&e.categories!=null&&e.categories.length===1){n({});return}if(e.categories!=null){if([...e.categories.slice(0,C),...e.categories.slice(C+1)].filter(y=>y.field!=null).length){const y={...e,categories:[...e.categories.slice(0,C),...e.categories.slice(C+1)]};n(y);return}n({})}},[n,e]),x=()=>{e.categories!=null&&n({...e,categories:[...e.categories,{...t.NEW_CATEGORY_BODY}]})},g=()=>{n({})},h=u.useCallback((C,S)=>{const y=t.getUpdatedFiltersOnValueChange({currentFilters:e,selectedOptions:C,categoryIndex:S});n(y)},[e,n]),j=()=>e.categories!=null?o.jsxRuntimeExports.jsxs(tc,{children:[o.jsxRuntimeExports.jsxs(Ms,{onClick:x,"data-testid":t.generateDataTestId("cockpit-filters-add-button"),children:[o.jsxRuntimeExports.jsx(Ql,{}),o.jsxRuntimeExports.jsx(t.StandardRegular,{children:t.appLocale.getLocalizedStrings().cockpit.filters.addFilterBtnText})]}),o.jsxRuntimeExports.jsxs(Ms,{onClick:g,"data-testid":t.generateDataTestId("cockpit-filters-clear-all-button"),children:[o.jsxRuntimeExports.jsx(Jl,{}),o.jsxRuntimeExports.jsx(t.StandardRegular,{children:t.appLocale.getLocalizedStrings().cockpit.filters.clearAllBtnText})]})]}):null,b=()=>e.categories==null?o.jsxRuntimeExports.jsx(As,{"data-testid":t.generateDataTestId("cockpit-filters-empty-state"),children:o.jsxRuntimeExports.jsx(Ds,{children:o.jsxRuntimeExports.jsxs(Fs,{children:[o.jsxRuntimeExports.jsx(Os,{children:o.jsxRuntimeExports.jsx(zs,{children:t.appLocale.getLocalizedStrings().cockpit.filters.filterByLabel})}),o.jsxRuntimeExports.jsx(Ns,{children:o.jsxRuntimeExports.jsx(Ls,{defaultMenuIsOpen:!0,onChange:d,selectedCockpitOption:i})})]})})}):o.jsxRuntimeExports.jsx(u.Fragment,{children:e.categories.map((C,S)=>{const f=bi(i).find(v=>v.value===C.field),E=f?.multiple,R=f?.type,I=f!=null?rs(i,f?.value):"",A=C.field??`${S}`;return o.jsxRuntimeExports.jsxs(Ds,{"data-testid":t.generateDataTestId("cockpit-filters-row",A),children:[o.jsxRuntimeExports.jsxs(Fs,{children:[o.jsxRuntimeExports.jsxs(Os,{children:[S===0&&o.jsxRuntimeExports.jsx(zs,{children:t.appLocale.getLocalizedStrings().cockpit.filters.filterByLabel}),S!==0?o.jsxRuntimeExports.jsx(ac,{"data-testid":t.generateDataTestId("cockpit-filters-combination-operator",A),children:o.jsxRuntimeExports.jsx(t.CombinationOperatorButton,{categoryCombinationOperator:e.categoryCombinationOperator,onChange:p,buttonsDisabled:S>1})}):null]}),o.jsxRuntimeExports.jsx(Ns,{"data-testid":t.generateDataTestId("cockpit-filters-category-dropdown",A),children:o.jsxRuntimeExports.jsx(Ls,{categoryIndex:S,value:C.field,onChange:d,selectedCockpitOption:i})})]}),C.field&&o.jsxRuntimeExports.jsxs(lc,{children:[o.jsxRuntimeExports.jsx(ec,{"data-testid":t.generateDataTestId("cockpit-filters-matching-operator",A),children:o.jsxRuntimeExports.jsx(t.MatchingOperatorDropdown,{categoryIndex:S,value:C.matchingOperator,onChange:l})}),o.jsxRuntimeExports.jsxs(sc,{children:[o.jsxRuntimeExports.jsx(rc,{categoryType:R,"data-testid":t.generateDataTestId("cockpit-filters-values-dropdown",A),children:o.jsxRuntimeExports.jsx(Yl,{options:r[C.field]!=null?r[C.field]:[],value:C.values,categoryIndex:S,categoryType:R,categoryLabel:I,showAnyAll:E??!1,onChange:h,valuesCombinationOperator:C.valuesCombinationOperator,onValuesCombinationOperatorChange:c})}),o.jsxRuntimeExports.jsx(oc,{onClick:()=>m(S),"data-testid":t.generateDataTestId("cockpit-filters-delete-row",A),children:o.jsxRuntimeExports.jsx(nc,{})})]})]})]},C.field?C.field+S:S)})});return o.jsxRuntimeExports.jsxs(As,{ref:a,"data-testid":t.generateDataTestId("cockpit-filters-selection-container"),children:[b(),j()]})});Ri.displayName="FiltersSelection";const cc=s.div`
|
|
354
354
|
padding: ${t.Space.sp4};
|
|
355
355
|
box-sizing: border-box;
|
|
356
356
|
height: ${e=>`${typeof e.height=="number"?e.height+"px":e.height}`};
|
|
357
357
|
background: ${e=>e.theme.colors.grey5};
|
|
358
358
|
max-height: 650px;
|
|
359
359
|
overflow: ${e=>e.height>"650"?"scroll":"visible"};
|
|
360
|
-
`,dc=({selectedCockpitOption:e,filters:n,disableFilters:r=!1,onFiltersChange:i,onSearchTextChanged:a,getCategoryWiseOptions:d,companiesLoaded:l=!0,filterText:c})=>{const p=u.useRef(null),[m,x]=u.useState(!1),
|
|
360
|
+
`,dc=({selectedCockpitOption:e,filters:n,disableFilters:r=!1,onFiltersChange:i,onSearchTextChanged:a,getCategoryWiseOptions:d,companiesLoaded:l=!0,filterText:c})=>{const p=u.useRef(null),[m,x]=u.useState(!1),g=u.useRef(!1),[h,j]=u.useState({management:{},portfolio:{},subscription:{},onboarding:{},audit:{},healthMonitor:{},taskManager:{},aiAccountant:{},creditAgent:{}}),[b,C]=u.useState(136),S=u.useRef(null),y=t.useWindowSizeContext(),f=u.useCallback(()=>{x(!1)},[]),E=u.useCallback(()=>{r===!1&&x(!0)},[r]);u.useEffect(()=>{d&&Object.keys(h[e]).length===0&&l&&j(v=>({...v,[e]:d()}))},[e,h,l]);const R=u.useCallback(()=>{if(n?.categories==null)return Ie;const v=S.current,T=v!=null?v.clientHeight:0;return t.sp[7]+(T>0?T:Ie)},[n]);u.useEffect(()=>{if(m!==g.current){C("auto");return}C(R())},[R,m]),u.useEffect(()=>{g.current=m},[m]),u.useEffect(()=>{b==="auto"&&C(R())},[b,R]);const I=()=>o.jsxRuntimeExports.jsx(t.FiltersPopover,{anchorEl:p.current,open:m,onClose:f,paperStyle:{overflow:"visible"},children:o.jsxRuntimeExports.jsx(cc,{height:b,windowSize:y,"data-testid":t.generateDataTestId("cockpit-filters-selection-wrapper"),children:n&&o.jsxRuntimeExports.jsx(uc,{"data-testid":t.generateDataTestId("cockpit-filters-selection"),children:o.jsxRuntimeExports.jsx(Ri,{filters:n,onFiltersChange:i,filterValues:h[e],selectedCockpitOption:e,ref:S})})})},n?.categories==null||n.categories.length===0?"smallBox":"largeBox"),A=n?.categories==null||n.categories.length===0?0:n.categories.filter(v=>v.field!=null&&v.values.length>0).length;return o.jsxRuntimeExports.jsxs(u.Fragment,{children:[o.jsxRuntimeExports.jsx(pc,{"data-testid":t.generateDataTestId("cockpit-filters-search-box"),children:o.jsxRuntimeExports.jsx(t.SearchBoxWithFilterButton,{isFilterBtnActive:m||A>0,searchPlaceholder:t.appLocale.getLocalizedStrings().cockpit.searchplaceholder,ref:p,isFilterDisabled:r,onSearchTextChanged:a,onFilterButtonClick:E,filtersCount:A,filterText:c})}),r!=!0&&I()]})},pc=s.div``,uc=s.div``,{common:{numbers:mc,strings:xc}}=t.appLocale.getLocalizedStrings(),hc=({onTabChange:e,allTabOptions:n,selectedOption:r,tabCounterDetails:i,getTitle:a})=>{const d=(c,p)=>{e(p)},l=c=>{let p=0;if(i?.forEach(m=>{m.tab===c&&(p=m.count)}),p!==0)return p<100?`${p}`:`${mc.maximumCount}${xc.plus}`};return o.jsxRuntimeExports.jsx(Sc,{"data-testid":t.generateDataTestId("cockpit-nav-switcher"),children:o.jsxRuntimeExports.jsx(gc,{value:r,onChange:d,centered:!0,"data-testid":t.generateDataTestId("cockpit-nav-switcher-tabs"),children:n.map(c=>o.jsxRuntimeExports.jsx(yc,{count:l(c),label:a(c),disableRipple:!0,"data-testid":t.generateDataTestId("cockpit-nav-switcher-tab",c)},c))})})},gc=s(o.Tabs)`
|
|
361
361
|
.MuiTabs-indicator {
|
|
362
362
|
background-color: ${e=>e.theme.colors.primary};
|
|
363
363
|
width: calc(100% - 20px);
|
|
@@ -395,7 +395,7 @@
|
|
|
395
395
|
border-radius: ${t.Space.sp12};
|
|
396
396
|
margin-left: 2px;
|
|
397
397
|
}
|
|
398
|
-
`,dt=({headerData:e,headerActions:n})=>{const{filterData:r,showBackButton:i=!1,allTabOptions:a,selectedTabOption:d,companiesLoaded:l,tabCounterDetails:c}=e,{onNavigateBack:p,onTabChange:m,filterActions:x}=n,
|
|
398
|
+
`,dt=({headerData:e,headerActions:n})=>{const{filterData:r,showBackButton:i=!1,allTabOptions:a,selectedTabOption:d,companiesLoaded:l,tabCounterDetails:c}=e,{onNavigateBack:p,onTabChange:m,filterActions:x}=n,g=x?.onFilterTextChanged,h=x?.onFiltersChange,j=f=>{let E="";return gs.forEach(R=>{R===f&&(E=t.appLocale.getLocalizedStrings().cockpit.titles[f])}),E.length!=0,E};let b=-1;a?.forEach((f,E)=>{f===d&&(b=E)}),b===-1&&d!=null&&console.warn("Selected unsupported tab option");const C=u.useCallback(f=>{d&&g?.(d,f)},[g,d]),S=u.useCallback(f=>{h&&d&&h(d,f)},[h,d]),y=f=>{const E=a?.[f];E!=null&&m?.(E)};return o.jsxRuntimeExports.jsxs(Ec,{"data-testid":t.generateDataTestId("cockpit-nav-header"),children:[o.jsxRuntimeExports.jsx(bc,{"data-testid":t.generateDataTestId("cockpit-nav-header-back-button"),onClick:()=>{p&&p()},children:i===!0&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(jc,{}),o.jsxRuntimeExports.jsx(Cc,{children:t.appLocale.getLocalizedStrings().cockpit.cockpitHeaderBackButton})]})}),a&&b!==-1&&a!=null&&m&&o.jsxRuntimeExports.jsx(Rc,{"data-testid":t.generateDataTestId("cockpit-nav-header-tab-switcher"),children:o.jsxRuntimeExports.jsx(hc,{tabCounterDetails:c,onTabChange:y,allTabOptions:a,selectedOption:b,getTitle:j})}),o.jsxRuntimeExports.jsx(fc,{"data-testid":t.generateDataTestId("cockpit-nav-header-search-wrapper"),children:r&&x&&o.jsxRuntimeExports.jsx($c,{"data-testid":t.generateDataTestId("cockpit-nav-header-filters"),children:o.jsxRuntimeExports.jsx(dc,{selectedCockpitOption:d,filters:r.filters,disableFilters:r.disableFilters,getCategoryWiseOptions:x.getCategoryWiseOptions,onSearchTextChanged:C,onFiltersChange:S,companiesLoaded:l,filterText:r.filterText})})})]})},fc=s.div`
|
|
399
399
|
min-width: 250px;
|
|
400
400
|
display: flex;
|
|
401
401
|
justify-content: flex-end;
|
|
@@ -510,7 +510,7 @@
|
|
|
510
510
|
top: ${t.Space.sp3};
|
|
511
511
|
border-radius: ${t.Space.sp2};
|
|
512
512
|
}
|
|
513
|
-
`,zc=({companyId:e,companyName:n,isEnabled:r,parentSubsidiaryRelationship:i,onViewDetailsLinkClicked:a})=>{const[d,l]=u.useState(!1),c=u.useRef(null),p=()=>i.parentInfo?t.appLocale.getLocalizedStrings().cockpit.parentSubsidiary.parent:i.subsidiaryInfo?t.appLocale.getLocalizedStrings().cockpit.parentSubsidiary.subsidiary:null,m=h=>{l(h)},x=u.useCallback(()=>{l(!1)},[]),
|
|
513
|
+
`,zc=({companyId:e,companyName:n,isEnabled:r,parentSubsidiaryRelationship:i,onViewDetailsLinkClicked:a})=>{const[d,l]=u.useState(!1),c=u.useRef(null),p=()=>i.parentInfo?t.appLocale.getLocalizedStrings().cockpit.parentSubsidiary.parent:i.subsidiaryInfo?t.appLocale.getLocalizedStrings().cockpit.parentSubsidiary.subsidiary:null,m=h=>{l(h)},x=u.useCallback(()=>{l(!1)},[]),g=()=>o.jsxRuntimeExports.jsx(Lc,{open:d,onClose:x,anchorEl:c.current,children:o.jsxRuntimeExports.jsx(Pc,{parentInfo:i.parentInfo,subsidiaryInfo:i.subsidiaryInfo,companyName:n,companyId:e,onViewDetailsLinkClicked:a})});return p()!=null?o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:x,children:o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Fc,{ref:c,onClick:h=>{h.stopPropagation(),m(!0)},className:"parent-subsidiary-tag",isExpanded:d,isEnabled:!!(r!=null&&r),"data-testid":t.generateDataTestId("cockpit-parent-subsidiary-tag"),children:p()}),g()]})}):null},Fc=s(t.ExtraSmallRegularSp)`
|
|
514
514
|
height: 18px;
|
|
515
515
|
color: ${e=>e.theme.colors.hero};
|
|
516
516
|
border: ${e=>`1px solid ${e.theme.colors.grey3}`};
|
|
@@ -524,7 +524,7 @@
|
|
|
524
524
|
align-items: center;
|
|
525
525
|
justify-content: flex-start;
|
|
526
526
|
width: 100%;
|
|
527
|
-
`;function ys({allowedValues:e,pickerStyles:{optionBackgroundColor:n,backgroundColor:r,selectedOptionBackgroundColor:i,optionTextStyle:a,titleTextAlignment:d,selectedOptionColor:l,titleTextStyle:c}={},onSelectedValueChanged:p,selectedValue:m,customization:{placeholderLabel:x}={}}){const
|
|
527
|
+
`;function ys({allowedValues:e,pickerStyles:{optionBackgroundColor:n,backgroundColor:r,selectedOptionBackgroundColor:i,optionTextStyle:a,titleTextAlignment:d,selectedOptionColor:l,titleTextStyle:c}={},onSelectedValueChanged:p,selectedValue:m,customization:{placeholderLabel:x}={}}){const g=e.map(R=>({...R.value,...R.options,label:R.value.name,value:J.isAllowedValueWithCode(R.value)?R.value.code:R.value.id})),h=g.find(R=>R.name===m?.value.name),j=o.useTheme(),b=n??j.colors.grey5,C=r??j.colors.grey5,S=i??j.colors.grey3,y=a??t.textStyles.standardRegular.cssObject,f=c??t.textStyles.smallRegular.cssObject,E={control:(R,{selectProps:I})=>({...R,border:0,height:"100%",backgroundColor:C,fill:I.menuIsOpen===!0?j.colors.primary:j.colors.grey1,boxShadow:C,":active":{backgroundColor:C},":hover":{fill:j.colors.primary},width:"auto",minHeight:"auto",cursor:"pointer"}),container:R=>({...R,backgroundColor:C,width:"100%",height:"100%"}),singleValue:(R,{data:I})=>({...R,display:"flex",flexDirection:"row",alignItems:"center",padding:"1px 6px",margin:`${t.Space.sp0}`,height:"20px",color:I.color?.toString()??j.colors.hero,background:I.bgColor?.toString()??j.colors.grey3,border:`1px solid ${I.borderColor?.toString()??j.colors.hero}`,borderRadius:t.sp[1]}),valueContainer:R=>({...R,maxWidth:"100%",height:"100%",cursor:"pointer",...f,overflow:"visible",minWidth:"auto",padding:0,display:"flex",justifyContent:d??"flex-start",alignItems:"center",flexWrap:"nowrap"}),menu:R=>({...R,backgroundColor:b,borderRadius:t.sp[1],boxShadow:`${t.Space.sp0} 2px ${t.Space.sp2} ${j.colors.dropShadowHover}`,whiteSpace:"nowrap",minWidth:"fit-content",zIndex:20,width:156,margin:0}),menuList:R=>({...R,borderRadius:t.sp[1]}),placeholder:(R,{isFocused:I})=>({...R,width:"100%",margin:0,color:I?j.colors.primary:"currentColor"}),option:(R,{isSelected:I,isFocused:A,isDisabled:v,data:T})=>({...R,...y,height:t.sp[6],color:I?l??j.colors.champion:j.colors.hero,backgroundColor:I?S:A?j.colors.background:b,cursor:v?"not-allowed":"pointer",borderTop:T.topBorder===!0?`1px solid ${j.colors.grey3}`:"none",":hover":{backgroundColor:j.colors.background,color:j.colors.primary},"& label":{paddingRight:"10px",cursor:v?"not-allowed":I?"default":"pointer"},">div>div>div:first-of-type":{display:"flex"}}),input:()=>({display:"inline-grid",color:j.colors.primary,overflow:"hidden",zIndex:2,minWidth:"auto",maxWidth:"100%",height:t.sp[4],input:{...t.textStyles.standardBold.cssObject}}),indicatorSeparator:()=>({}),dropdownIndicator:()=>({})};return o.jsxRuntimeExports.jsx(_c,{onClick:R=>R.stopPropagation(),"data-testid":t.generateDataTestId("cockpit-single-value-picker"),children:o.jsxRuntimeExports.jsx(o.StateManagedSelect$1,{onChange:R=>{if(R){const I=e.find(A=>A.value.name===R.name);p(I)}},menuPlacement:"auto",minMenuHeight:208,defaultValue:h,value:h,menuShouldScrollIntoView:!1,components:{Option:Yc,DropdownIndicator:Wc,IndicatorSeparator:Vc,SingleValue:Zc},hideSelectedOptions:!1,closeMenuOnSelect:!1,styles:E,options:g,isClearable:!1,isSearchable:!1,placeholder:o.jsxRuntimeExports.jsxs(Uc,{"data-testid":t.generateDataTestId("cockpit-single-value-picker-placeholder"),children:[o.jsxRuntimeExports.jsx(Hc,{children:o.jsxRuntimeExports.jsx(Kc,{})}),o.jsxRuntimeExports.jsx(Gc,{children:x??"Select..."})]})})})}const Wc=()=>null,Vc=()=>null,Uc=s.div`
|
|
528
528
|
display: flex;
|
|
529
529
|
align-items: center;
|
|
530
530
|
color: ${e=>e.theme.colors.grey1};
|
|
@@ -693,7 +693,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
693
693
|
color: ${e=>e.optionHover||e.selected?e.color:e.theme.colors.primary};
|
|
694
694
|
`,Wd=s.div`
|
|
695
695
|
color: ${e=>e.selected||e.optionHover?e.theme.colors.primary:e.theme.colors.hero};
|
|
696
|
-
`,Vd=({option:e,selected:n,onClick:r,iconName:i,color:a})=>{const[d,l]=u.useState(!1),c=()=>{r&&r(e.id)},p=()=>{l(
|
|
696
|
+
`,Vd=({option:e,selected:n,onClick:r,iconName:i,color:a})=>{const[d,l]=u.useState(!1),c=()=>{r&&r(e.id)},p=()=>{l(g=>!g)},m=()=>o.jsxRuntimeExports.jsxs(zd,{children:[o.jsxRuntimeExports.jsxs(Fd,{children:[o.jsxRuntimeExports.jsx(_d,{optionHover:d,selected:n,color:a,children:o.jsxRuntimeExports.jsx(t.StandardMedium,{children:e.name})}),n&&o.jsxRuntimeExports.jsx(Bd,{})]}),o.jsxRuntimeExports.jsx(Wd,{optionHover:d,selected:n,color:a,children:o.jsxRuntimeExports.jsx(t.SmallRegular,{children:e.description})})]}),x=()=>o.jsxRuntimeExports.jsx("div",{children:o.jsxRuntimeExports.jsx(ln,{iconName:i,stopAnimation:!d})});return o.jsxRuntimeExports.jsxs(Md,{onMouseEnter:p,onMouseLeave:p,optionCode:e.id,onClick:c,selected:n,color:a,children:[x(),m()]})},Ud=s.ul`
|
|
697
697
|
list-style-type: none;
|
|
698
698
|
padding: 0;
|
|
699
699
|
margin: 0;
|
|
@@ -773,11 +773,11 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
773
773
|
justify-content: flex-end;
|
|
774
774
|
column-gap: ${t.Space.sp3};
|
|
775
775
|
flex: 1;
|
|
776
|
-
`,dp=({customerSatisfactionOptions:e,noteValue:n,selectedOption:r,savedOption:i,lastUpdatedBy:a,lastUpdatedTime:d,saveBtnDisabled:l,onCancel:c,onSave:p,onOptionChange:m,onNoteChange:x})=>{const
|
|
776
|
+
`,dp=({customerSatisfactionOptions:e,noteValue:n,selectedOption:r,savedOption:i,lastUpdatedBy:a,lastUpdatedTime:d,saveBtnDisabled:l,onCancel:c,onSave:p,onOptionChange:m,onNoteChange:x})=>{const g=()=>o.jsxRuntimeExports.jsx(ip,{selectedOption:r,children:o.jsxRuntimeExports.jsx(Hd,{onChange:m,value:r,customerSatisfactionOptions:e})}),h=b=>{x&&x(b)},j=()=>{if(r==null)return null;const b=i==null?t.appLocale.getLocalizedStrings().cockpit.management.customerSatisfaction.noteLabel:i==r?"":t.appLocale.getLocalizedStrings().cockpit.management.customerSatisfaction.updateNoteLabel;return o.jsxRuntimeExports.jsxs(ap,{children:[o.jsxRuntimeExports.jsx(Zd,{label:b,onChange:h,value:n}),o.jsxRuntimeExports.jsxs(lp,{children:[a&&d&&o.jsxRuntimeExports.jsx(wi,{time:d,user:a}),o.jsxRuntimeExports.jsxs(cp,{children:[o.jsxRuntimeExports.jsx(t.Button,{size:"small",label:"Cancel",onClick:c}),o.jsxRuntimeExports.jsx(t.Button,{label:"Save",disabled:l,variant:"primary",onClick:p,size:"small"})]})]})]})};return o.jsxRuntimeExports.jsxs(rp,{children:[g(),j()]})},pp=({open:e,onClose:n,anchorEl:r,children:i})=>{const a=o.useTheme();return o.jsxRuntimeExports.jsx(o.Popover,{anchorEl:r,open:e,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},PaperProps:{style:{width:"416px",marginTop:"6px",background:a.colors.grey5}},onClose:n,children:i})},up=s.div`
|
|
777
777
|
display: flex;
|
|
778
778
|
column-gap: ${t.Space.sp3};
|
|
779
779
|
align-items: center;
|
|
780
|
-
`,mp=({customerSatisfaction:e,onSave:n})=>{const[r,i]=u.useState(),[a,d]=u.useState(),[l,c]=u.useState(""),p=u.useRef(null),m=u.useRef(null),x=u.useCallback(E=>{const{savedOption:R,savedNote:I}=is({...e,activeEntity:E});d(R),c(I)},[e]),S=u.useCallback(E=>{if(E!==a&&r!=null){const{savedOption:R,savedNote:I}=is({...e,activeEntity:r});if(d(E),R!=null){if(E===R){c(I);return}c(Ei(I));return}c("")}},[a,r,e]),h=u.useCallback(E=>{c(E.target.value)},[]),C=u.useCallback((E,R)=>{R.preventDefault(),i(E),x(E)},[x]),b=u.useCallback(()=>{i(void 0),d(void 0),c("")},[]),f=u.useCallback(()=>{const E={...e};E.customerSatisfactionId=e.customerSatisfactionId,r===De.CUSTOMER&&(E.customerRating=a,E.customerNote=l),r===De.TEAM&&(E.teamRating=a,E.teamNote=l),i(void 0),n(E)},[a,l,r,e,n]),g=r===De.CUSTOMER?To:r===De.TEAM?eo:{},j=Id({...e,activeEntity:r,selectedOption:a,noteValue:l}),y=()=>{const E=r===De.CUSTOMER?p.current:m.current;return o.jsxRuntimeExports.jsx(pp,{onClose:b,anchorEl:E,open:!!r,children:o.jsxRuntimeExports.jsx(dp,{customerSatisfactionOptions:g,selectedOption:a,noteValue:l,lastUpdatedBy:Ld({...e,activeEntity:r}),lastUpdatedTime:Pd({...e,activeEntity:r}),savedOption:r===De.CUSTOMER?e.customerRating:e.teamRating,saveBtnDisabled:j,onCancel:b,onSave:f,onOptionChange:S,onNoteChange:h})})};return o.jsxRuntimeExports.jsxs(up,{children:[o.jsxRuntimeExports.jsx(as,{ref:p,savedRating:e.customerRating,isActive:r===De.CUSTOMER,entityType:De.CUSTOMER,onClick:C}),o.jsxRuntimeExports.jsx(as,{ref:m,savedRating:e.teamRating,isActive:r===De.TEAM,entityType:De.TEAM,onClick:C}),y()]})},xp=({name:e,value:n,registerOptions:r})=>{const{control:i}=o.useFormContext();return o.jsxRuntimeExports.jsx(o.Controller,{name:e,control:i,defaultValue:n,rules:r,render:({field:{onChange:a}})=>o.jsxRuntimeExports.jsx(mp,{customerSatisfaction:n,onSave:a})})},hp={blocked:{bgColor:new o.Color(t.Colors.importantLight),color:new o.Color(t.Colors.important),borderColor:new o.Color(t.Colors.important)},missing_info:{bgColor:new o.Color(t.Colors.importantLight),color:new o.Color(t.Colors.important),borderColor:new o.Color(t.Colors.important)},in_progress:{bgColor:new o.Color(t.Colors.alertLight),color:new o.Color(t.Colors.alertDark),borderColor:new o.Color(t.Colors.alertDark)},awaiting_client_approval:{bgColor:new o.Color(t.Colors.infoLight),color:new o.Color(t.Colors.infoDark),borderColor:new o.Color(t.Colors.infoDark)},no_info_received:{bgColor:new o.Color(t.lightColors.grey3),color:new o.Color(t.lightColors.hero),borderColor:new o.Color(t.lightColors.hero)},extension_filed:{bgColor:new o.Color(t.Colors.successLight),color:new o.Color(t.Colors.successDark),borderColor:new o.Color(t.Colors.successDark)},return_filed:{bgColor:new o.Color(t.Colors.successLight),color:new o.Color(t.Colors.successDark),borderColor:new o.Color(t.Colors.successDark)}},gp=e=>e.map(n=>({value:n,options:hp[n.code]})),Sp=({onSelectionChanged:e,selectedTaxStatusIndex:n,allTaxStatuses:r})=>{const i=gp(r);return o.jsxRuntimeExports.jsx(ys,{customization:{placeholderLabel:t.appLocale.getLocalizedStrings().cockpit.management.placeholder.taxStatus},onSelectedValueChanged:a=>{const d=i.findIndex(l=>l.value.code===(a?.value).code);e(d,a?.value)},allowedValues:i,selectedValue:n!=null?i[n]:void 0})},yp=({value:e,registerOptions:n,name:r})=>{const{control:i}=o.useFormContext();return o.jsxRuntimeExports.jsx(o.Controller,{name:r,control:i,defaultValue:e,rules:n,render:({field:{value:a,onChange:d}})=>o.jsxRuntimeExports.jsx(Sp,{onSelectionChanged:l=>d({allGroups:e.allTaxStatuses,selectedValue:e.allTaxStatuses[l]}),selectedTaxStatusIndex:e.allTaxStatuses.findIndex(l=>l.code===a.selectedValue?.code),allTaxStatuses:e.allTaxStatuses})})},Vt=e=>le.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M6 8H10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M6 6H10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M9.5 14.5C9.62209 14.5 9.73252 14.4545 9.81934 14.3818C9.83066 14.3724 9.843 14.364 9.85352 14.3535L13.3535 10.8535C13.4221 10.7849 13.4706 10.6965 13.4902 10.5977C13.4966 10.5657 13.5 10.533 13.5 10.5V2.5C13.5 2.23479 13.3946 1.98051 13.207 1.79297C13.0195 1.60543 12.7652 1.5 12.5 1.5H3.5C3.23478 1.5 2.98051 1.60543 2.79297 1.79297C2.60543 1.98051 2.5 2.23478 2.5 2.5V13.5C2.5 13.7652 2.60543 14.0195 2.79297 14.207C2.9805 14.3946 3.23478 14.5 3.5 14.5H9.5ZM3.5 2.5H12.5V10H9.5C9.22386 10 9 10.2239 9 10.5V13.5H3.5V2.5ZM10 11H11.793L10 12.793V11Z",fill:"currentColor"})),vi=e=>le.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M11 14.9629H2V3.86499",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M10.0559 8.31177H11.7836",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M10.0559 5.7395H11.7836",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M6.52014 5.73978L7.163 6.38264L8.44871 5.09692",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M6.52014 8.31107L7.163 8.95393L8.44871 7.66821",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M13.5591 1.02539H4.74212C4.49865 1.02539 4.30127 1.36118 4.30127 1.77539V12.2754C4.30127 12.6896 4.49865 13.0254 4.74212 13.0254H13.5591C13.8026 13.0254 14 12.6896 14 12.2754V1.77539C14 1.36118 13.8026 1.02539 13.5591 1.02539Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{cockpit:{management:{placeholder:Us,editMonthInsight:fp,createMonthInsight:Cp,monthInsightSent:jp,monthInsightNotReady:bp,monthInsightsCanBeSentFromDashboard:Rp,sendMonthInsightsFromDashboardWhenReady:$p,monthInsightsCanBeEditedFromDashboard:Ep,monthEndHistoryUnavailable:wp}},dateFormat:ki,common:bo}=t.appLocale.getLocalizedStrings(),vp=["status","group","reportSent","taxStatus","customerSatisfaction"],kp=({reportSent:e,hasMonthEndEmailHistory:n,onReportSentClick:r})=>{if(e.date==null)return o.jsxRuntimeExports.jsx(Cn,{children:bo.strings.hyphen});const i=`${bo.datePicker.businessDay} ${e.businessDay??bo.strings.empty}${bo.strings.colon} ${e.date.format(ki.visual.DMMMFormat)}`;return n?o.jsxRuntimeExports.jsx(Cn,{onClick:r,children:i}):o.jsxRuntimeExports.jsx(t.Tooltip,{placement:"bottom-end",variant:"small-description",data:wp,style:{color:t.Colors.championDark,marginTop:t.Space.sp2},display:"flex",children:o.jsxRuntimeExports.jsx(Cn,{children:i})})},Tp=({companyView:e,hasMonthEndEmailHistory:n,companiesExcludedFromMonthEndReport:r,showDetailsPageLink:i,allUsers:a,loggedInUserRole:d,companyNameSticky:l,totalHeight:c,isExpenseAutomationEnabledForUser:p,addThreadRequestThreadId:m,targetElementFromNavigation:x,resetTargetElementFromNavigation:S,setNoteData:h,setElementRef:C,setAddThreadRequestThreadId:b,changeHandlers:f,onCompanyNameClicked:g,onPassportIconClicked:j,onTaskIconClicked:y,onViewDetailsLinkClicked:E,onMonthEndReportPageClick:R,showMonthEndReportHistoricData:I})=>{const[A,v]=u.useState(null),T=t.useWindowSizeContext(),F=o.useForm({mode:"all"}),[D,K]=u.useState(!1),{companyId:M,name:Y}=e.company.company.companyInfo,G=["companyData.status","companyData.group","companyData.controller","companyData.customerSuccessManager","companyData.preparer","companyData.reviewer","companyData.apAnalyst","companyData.reportSent","companyData.taxStatus","companyData.taxLead","companyData.customerSatisfaction"],w=`cockpit_${M}`,P="management.notes",{threads:B,isLoading:k}=t.useFilteredThreads({entityType:P,companyId:M},!1),{openThread:O,threads:z,addThread:Z,removeThread:ie,setOpenThread:N}=u.useContext(t.ThreadsContext),H=O!==null?z.get(O):null,L=O?.includes(M)===!0,Q=O!=null&&z.get(O)==null&&L,se=m!=null&&z.get(m)?.metadata.companyId===M,X=(_,pe)=>{G.includes(_)&&f(M,pe)};u.useEffect(()=>{const _=F.watch((pe,{name:ye})=>{ye!=null&&pe.companyData!=null&&o.defer(()=>X(ye,Gp(pe.companyData,ye)))});return()=>{_.unsubscribe()}});const re=Kp(e,a),te=()=>{e.company.schema.status.length===0?K(!0):g(e)},he=()=>{R?.(e)},fe=d?.userRoles?.includes("admin"),be=e.company.company.configInfo.isMonthEndReportInDraft,W=J.canSendMonthEndEmailReport(e,r),ee=J.shouldEnableCalendarPickerForLastReportSent(e,r),ge=e.company.company.companyInfo.bookCloseDate,ve=e.company.company.managementInfo.lastReportSentDate,Re=e.taskSummary?.count??0,$=u.useCallback(()=>{O?.includes(t.NEW_THREAD_SUFFIX)===!0&&ie(O),m!=null&&b(void 0)},[m,O,ie,b]),Ce=u.useCallback(_=>{if(_===O)N(null);else if(z.has(_))N(_);else if(_.includes(t.NEW_THREAD_SUFFIX)){const[pe,ye]=_.replace(t.NEW_THREAD_SUFFIX,"").split("."),ke=Wt(Rt(pe),J.toManagementSortKeyType(ye),M,Y);Z(_,{type:"thread",id:_,roomId:w,createdAt:new Date,updatedAt:new Date,comments:[],metadata:ke,resolved:!1}),N(_)}},[M,Y,O,z,Z,N,w]),ae=u.useCallback((_,pe,ye=!1)=>{const ke=Ct.find(ue=>ue.key===pe);if(S(),ke!=null&&(_.type==="contextmenu"||ye===!0)){if(ke.isThreadAllowed===!1)return;$(),_.preventDefault(),_.stopPropagation();const ue=t.toCollaborationEntityType({tab:"management",key:ke.key});if(_.target instanceof HTMLElement||_.target instanceof SVGElement)if(ye===!0&&_.target instanceof HTMLElement)v(_.target.parentElement);else if(_.target instanceof HTMLElement){const Pe=Ss(_.target,oe);v(Pe||_.target)}else{const Pe=_.target.closest(`.${oe}`);Pe instanceof HTMLElement&&v(Pe)}const U=[...t.getFilteredThreads(z,{entityType:ue,companyId:M},"both")],Oe=U.length>0&&U[0].length>0?U[0][0]:Le("management",ke.key,M);z.has(Oe)?Ce(Oe):m===Oe?b(void 0):(b(Oe),N(null))}},[z,M,m,Ce,b,N,S,$]),ce=u.useCallback((_,pe)=>{_.stopPropagation();const ye=Le("management",pe,M);b(void 0),Ce(ye)},[M,b,Ce]),$e=()=>{re.reportSent.date!=null&&I(M,re.reportSent.date)},V=_=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:_.isElementThreadOpen??!1,isElementThreadPresent:_.isElementThreadPresent??!1,itemKey:_.itemKey,elementThreadId:_.elementThreadId??"",roomId:w,addThreadRequestThreadId:m,openThreadId:O,threadStyle:_.threadStyle,openThreadMetadata:H?.metadata??null,onElementClick:ae,onAddThreadClick:ce,targetElement:x??A});return o.jsxRuntimeExports.jsxs(o.FormProvider,{...F,children:[D===!0?o.jsxRuntimeExports.jsx(gd,{companyDomain:e.company.company.companyInfo.primaryEmailDomain,hasAdminRole:fe,onCancelClick:()=>K(!1),onConnectClick:()=>g(e)}):null,o.jsxRuntimeExports.jsx("form",{style:{height:"100%"},children:o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{S(),m!=null&&(b(void 0),m.includes(t.NEW_THREAD_SUFFIX)&&ie(m))},children:o.jsxRuntimeExports.jsx(Lp,{windowSize:T,hoverParentSubsidiaryTag:i??!1,isThreadOpen:L||se,totalHeight:c,isCreationInProgress:Q,children:Ct.map((_,pe)=>{const ye=t.toCollaborationEntityType({tab:"management",key:_.key}),ke=Ct.length-2<=pe,ue=[...t.getFilteredThreads(z,{entityType:ye,companyId:M},"both")],U=ue.length>0&&ue[0].length>0?ue[0][0]:Le("management",_.key,M),Oe=z.get(U),Pe=Oe!=null&&Oe.resolved===!1,Be=U===O,me=m===U;switch(_.key){case"companyName":return o.jsxRuntimeExports.jsxs(Op,{companyNameSticky:l,columnWidth:_.width,windowSize:T,isThreadOpen:Be||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),ref:q=>{C(M,_.key,q)},children:[o.jsxRuntimeExports.jsxs(Ap,{children:[o.jsxRuntimeExports.jsx(Dp,{className:"company-name",onClick:q=>{q.preventDefault(),q.stopPropagation(),te()},children:re.companyName}),re.parentSubsidiaryInfo&&o.jsxRuntimeExports.jsx(zc,{companyId:re.companyId,isEnabled:i,onViewDetailsLinkClicked:E,companyName:re.companyName,parentSubsidiaryRelationship:re.parentSubsidiaryInfo}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:Be,targetElement:x??A,roomId:w,openThreadId:O,openThreadMetadata:H?.metadata??null})]}),o.jsxRuntimeExports.jsxs(Np,{children:[o.jsxRuntimeExports.jsxs(Fp,{onClick:q=>{q.preventDefault(),h({roomId:w,companyId:M,companyName:Y,entityType:P})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:B.length,isLoading:k}),o.jsxRuntimeExports.jsx(Bp,{})]}),o.jsxRuntimeExports.jsx(Mp,{onClick:q=>{q.preventDefault(),j(e)},children:o.jsxRuntimeExports.jsx(zp,{className:"passportIcon"})})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:Pe,itemKey:_.key,style:{left:t.Space.sp4},onElementClick:ae}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Le("management",_.key,M),addThreadRequestThreadId:m,itemKey:_.key,onAddThreadClick:ce})]},U);case"task":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{C(M,_.key,q)},columnWidth:_.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),children:[o.jsxRuntimeExports.jsxs(_p,{onClick:q=>{q.preventDefault(),y?.(e)},children:[o.jsxRuntimeExports.jsx(Wp,{}),Re>0?o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{isLoading:!1,count:Re}):null]}),V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"status":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{C(M,_.key,q)},columnWidth:_.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),children:[o.jsxRuntimeExports.jsx(td,{name:"companyData.status",value:re.status}),V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"group":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{C(M,_.key,q)},columnWidth:_.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),children:[o.jsxRuntimeExports.jsx(vd,{name:"companyData.group",value:re.group}),V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"plans":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{C(M,_.key,q)},columnWidth:_.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),children:[o.jsxRuntimeExports.jsx(Cd,{chips:re.plansAndAddons}),V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"satisfaction":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{C(M,_.key,q)},windowSize:T,columnWidth:_.width,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),children:[o.jsxRuntimeExports.jsx(xp,{name:"companyData.customerSatisfaction",value:re.customerSatisfaction}),V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"bookCloseDate":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{C(M,_.key,q)},columnWidth:_.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),children:[ge?.format(ki.visual.MMMDCommaYYYYformat)??bo.strings.hyphen,V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"reportSent":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{C(M,_.key,q)},columnWidth:_.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),style:{alignItems:"center"},children:[ee&&o.jsxRuntimeExports.jsx(Ip,{children:o.jsxRuntimeExports.jsx(t.ZeniDatePickerField,{name:"companyData.reportSent",defaultValue:re.reportSent})}),!ee&&o.jsxRuntimeExports.jsx(kp,{reportSent:re.reportSent,onReportSentClick:$e,hasMonthEndEmailHistory:n}),o.jsxRuntimeExports.jsx(Pp,{children:p?o.jsxRuntimeExports.jsx(Xp,{isMonthEndReportInDraft:be,bookCloseDate:ge,lastReportSentDate:ve,enableCompanyMonthEndReportBtn:W,handleMonthEndReportPageClick:he}):o.jsxRuntimeExports.jsx(ls,{isMonthEndReportInDraft:be,bookCloseDate:ge,lastReportSentDate:ve,enableCompanyMonthEndReportBtn:W,isExpenseAutomationEnabledForUser:p,handleMonthEndReportPageClick:he})}),V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"customerSuccessManager":case"preparer":case"reviewer":case"apAnalyst":case"controller":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{C(M,_.key,q)},columnWidth:_.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),children:[o.jsxRuntimeExports.jsx(t.UserMultiSelectField,{name:`companyData.${_.key}`,value:re[_.key],placeholderLabel:Us[_.key],pickerStyles:{titleTextStyle:t.textStyles.largeRegular,multiValueLabelTitleStyle:t.textStyles.largeRegular}}),V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"taxStatus":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{C(M,_.key,q)},columnWidth:_.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),children:[o.jsxRuntimeExports.jsx(yp,{name:"companyData.taxStatus",value:re.taxStatus}),V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"taxLead":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{C(M,_.key,q)},columnWidth:_.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),children:[o.jsxRuntimeExports.jsx(t.UserMultiSelectField,{name:"companyData.taxLead",value:re.taxLead,placeholderLabel:Us.taxLead,pickerStyles:{titleTextStyle:t.textStyles.largeRegular,multiValueLabelTitleStyle:t.textStyles.largeRegular}}),V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"monthlyRecurringRevenue":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{C(M,_.key,q)},columnWidth:_.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),children:[t.amountToString("0,0",re.monthlyRecurringRevenue),V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"annualRecurringRevenue":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{C(M,_.key,q)},columnWidth:_.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),children:[t.amountToString("0,0",re.annualRecurringRevenue),V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);default:return null}})})})})]})},ls=({enableCompanyMonthEndReportBtn:e,isMonthEndReportInDraft:n,isExpenseAutomationEnabledForUser:r,bookCloseDate:i,lastReportSentDate:a,handleMonthEndReportPageClick:d})=>o.jsxRuntimeExports.jsx(t.Button,{size:"small",onClick:d,variant:"primary",label:Zp(e,n,i,a),disabled:!e||r,style:e?{}:{background:"transparent"},prefixIcon:e&&n?o.jsxRuntimeExports.jsx(Vp,{}):void 0}),Lp=s.div`
|
|
780
|
+
`,mp=({customerSatisfaction:e,onSave:n})=>{const[r,i]=u.useState(),[a,d]=u.useState(),[l,c]=u.useState(""),p=u.useRef(null),m=u.useRef(null),x=u.useCallback(E=>{const{savedOption:R,savedNote:I}=is({...e,activeEntity:E});d(R),c(I)},[e]),g=u.useCallback(E=>{if(E!==a&&r!=null){const{savedOption:R,savedNote:I}=is({...e,activeEntity:r});if(d(E),R!=null){if(E===R){c(I);return}c(Ei(I));return}c("")}},[a,r,e]),h=u.useCallback(E=>{c(E.target.value)},[]),j=u.useCallback((E,R)=>{R.preventDefault(),i(E),x(E)},[x]),b=u.useCallback(()=>{i(void 0),d(void 0),c("")},[]),C=u.useCallback(()=>{const E={...e};E.customerSatisfactionId=e.customerSatisfactionId,r===De.CUSTOMER&&(E.customerRating=a,E.customerNote=l),r===De.TEAM&&(E.teamRating=a,E.teamNote=l),i(void 0),n(E)},[a,l,r,e,n]),S=r===De.CUSTOMER?To:r===De.TEAM?eo:{},y=Id({...e,activeEntity:r,selectedOption:a,noteValue:l}),f=()=>{const E=r===De.CUSTOMER?p.current:m.current;return o.jsxRuntimeExports.jsx(pp,{onClose:b,anchorEl:E,open:!!r,children:o.jsxRuntimeExports.jsx(dp,{customerSatisfactionOptions:S,selectedOption:a,noteValue:l,lastUpdatedBy:Ld({...e,activeEntity:r}),lastUpdatedTime:Pd({...e,activeEntity:r}),savedOption:r===De.CUSTOMER?e.customerRating:e.teamRating,saveBtnDisabled:y,onCancel:b,onSave:C,onOptionChange:g,onNoteChange:h})})};return o.jsxRuntimeExports.jsxs(up,{children:[o.jsxRuntimeExports.jsx(as,{ref:p,savedRating:e.customerRating,isActive:r===De.CUSTOMER,entityType:De.CUSTOMER,onClick:j}),o.jsxRuntimeExports.jsx(as,{ref:m,savedRating:e.teamRating,isActive:r===De.TEAM,entityType:De.TEAM,onClick:j}),f()]})},xp=({name:e,value:n,registerOptions:r})=>{const{control:i}=o.useFormContext();return o.jsxRuntimeExports.jsx(o.Controller,{name:e,control:i,defaultValue:n,rules:r,render:({field:{onChange:a}})=>o.jsxRuntimeExports.jsx(mp,{customerSatisfaction:n,onSave:a})})},hp={blocked:{bgColor:new o.Color(t.Colors.importantLight),color:new o.Color(t.Colors.important),borderColor:new o.Color(t.Colors.important)},missing_info:{bgColor:new o.Color(t.Colors.importantLight),color:new o.Color(t.Colors.important),borderColor:new o.Color(t.Colors.important)},in_progress:{bgColor:new o.Color(t.Colors.alertLight),color:new o.Color(t.Colors.alertDark),borderColor:new o.Color(t.Colors.alertDark)},awaiting_client_approval:{bgColor:new o.Color(t.Colors.infoLight),color:new o.Color(t.Colors.infoDark),borderColor:new o.Color(t.Colors.infoDark)},no_info_received:{bgColor:new o.Color(t.lightColors.grey3),color:new o.Color(t.lightColors.hero),borderColor:new o.Color(t.lightColors.hero)},extension_filed:{bgColor:new o.Color(t.Colors.successLight),color:new o.Color(t.Colors.successDark),borderColor:new o.Color(t.Colors.successDark)},return_filed:{bgColor:new o.Color(t.Colors.successLight),color:new o.Color(t.Colors.successDark),borderColor:new o.Color(t.Colors.successDark)}},gp=e=>e.map(n=>({value:n,options:hp[n.code]})),Sp=({onSelectionChanged:e,selectedTaxStatusIndex:n,allTaxStatuses:r})=>{const i=gp(r);return o.jsxRuntimeExports.jsx(ys,{customization:{placeholderLabel:t.appLocale.getLocalizedStrings().cockpit.management.placeholder.taxStatus},onSelectedValueChanged:a=>{const d=i.findIndex(l=>l.value.code===(a?.value).code);e(d,a?.value)},allowedValues:i,selectedValue:n!=null?i[n]:void 0})},yp=({value:e,registerOptions:n,name:r})=>{const{control:i}=o.useFormContext();return o.jsxRuntimeExports.jsx(o.Controller,{name:r,control:i,defaultValue:e,rules:n,render:({field:{value:a,onChange:d}})=>o.jsxRuntimeExports.jsx(Sp,{onSelectionChanged:l=>d({allGroups:e.allTaxStatuses,selectedValue:e.allTaxStatuses[l]}),selectedTaxStatusIndex:e.allTaxStatuses.findIndex(l=>l.code===a.selectedValue?.code),allTaxStatuses:e.allTaxStatuses})})},Vt=e=>le.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M6 8H10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M6 6H10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M9.5 14.5C9.62209 14.5 9.73252 14.4545 9.81934 14.3818C9.83066 14.3724 9.843 14.364 9.85352 14.3535L13.3535 10.8535C13.4221 10.7849 13.4706 10.6965 13.4902 10.5977C13.4966 10.5657 13.5 10.533 13.5 10.5V2.5C13.5 2.23479 13.3946 1.98051 13.207 1.79297C13.0195 1.60543 12.7652 1.5 12.5 1.5H3.5C3.23478 1.5 2.98051 1.60543 2.79297 1.79297C2.60543 1.98051 2.5 2.23478 2.5 2.5V13.5C2.5 13.7652 2.60543 14.0195 2.79297 14.207C2.9805 14.3946 3.23478 14.5 3.5 14.5H9.5ZM3.5 2.5H12.5V10H9.5C9.22386 10 9 10.2239 9 10.5V13.5H3.5V2.5ZM10 11H11.793L10 12.793V11Z",fill:"currentColor"})),vi=e=>le.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M11 14.9629H2V3.86499",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M10.0559 8.31177H11.7836",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M10.0559 5.7395H11.7836",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M6.52014 5.73978L7.163 6.38264L8.44871 5.09692",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M6.52014 8.31107L7.163 8.95393L8.44871 7.66821",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M13.5591 1.02539H4.74212C4.49865 1.02539 4.30127 1.36118 4.30127 1.77539V12.2754C4.30127 12.6896 4.49865 13.0254 4.74212 13.0254H13.5591C13.8026 13.0254 14 12.6896 14 12.2754V1.77539C14 1.36118 13.8026 1.02539 13.5591 1.02539Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{cockpit:{management:{placeholder:Us,editMonthInsight:fp,createMonthInsight:Cp,monthInsightSent:jp,monthInsightNotReady:bp,monthInsightsCanBeSentFromDashboard:Rp,sendMonthInsightsFromDashboardWhenReady:$p,monthInsightsCanBeEditedFromDashboard:Ep,monthEndHistoryUnavailable:wp}},dateFormat:ki,common:bo}=t.appLocale.getLocalizedStrings(),vp=["status","group","reportSent","taxStatus","customerSatisfaction"],kp=({reportSent:e,hasMonthEndEmailHistory:n,onReportSentClick:r})=>{if(e.date==null)return o.jsxRuntimeExports.jsx(Cn,{children:bo.strings.hyphen});const i=`${bo.datePicker.businessDay} ${e.businessDay??bo.strings.empty}${bo.strings.colon} ${e.date.format(ki.visual.DMMMFormat)}`;return n?o.jsxRuntimeExports.jsx(Cn,{onClick:r,children:i}):o.jsxRuntimeExports.jsx(t.Tooltip,{placement:"bottom-end",variant:"small-description",data:wp,style:{color:t.Colors.championDark,marginTop:t.Space.sp2},display:"flex",children:o.jsxRuntimeExports.jsx(Cn,{children:i})})},Tp=({companyView:e,hasMonthEndEmailHistory:n,companiesExcludedFromMonthEndReport:r,showDetailsPageLink:i,allUsers:a,loggedInUserRole:d,companyNameSticky:l,totalHeight:c,isExpenseAutomationEnabledForUser:p,addThreadRequestThreadId:m,targetElementFromNavigation:x,resetTargetElementFromNavigation:g,setNoteData:h,setElementRef:j,setAddThreadRequestThreadId:b,changeHandlers:C,onCompanyNameClicked:S,onPassportIconClicked:y,onTaskIconClicked:f,onViewDetailsLinkClicked:E,onMonthEndReportPageClick:R,showMonthEndReportHistoricData:I})=>{const[A,v]=u.useState(null),T=t.useWindowSizeContext(),F=o.useForm({mode:"all"}),[D,K]=u.useState(!1),{companyId:M,name:Y}=e.company.company.companyInfo,G=["companyData.status","companyData.group","companyData.controller","companyData.customerSuccessManager","companyData.preparer","companyData.reviewer","companyData.apAnalyst","companyData.reportSent","companyData.taxStatus","companyData.taxLead","companyData.customerSatisfaction"],w=`cockpit_${M}`,P="management.notes",{threads:B,isLoading:k}=t.useFilteredThreads({entityType:P,companyId:M},!1),{openThread:O,threads:z,addThread:Z,removeThread:ie,setOpenThread:N}=u.useContext(t.ThreadsContext),H=O!==null?z.get(O):null,L=O?.includes(M)===!0,Q=O!=null&&z.get(O)==null&&L,se=m!=null&&z.get(m)?.metadata.companyId===M,X=(_,pe)=>{G.includes(_)&&C(M,pe)};u.useEffect(()=>{const _=F.watch((pe,{name:ye})=>{ye!=null&&pe.companyData!=null&&o.defer(()=>X(ye,Gp(pe.companyData,ye)))});return()=>{_.unsubscribe()}});const re=Kp(e,a),te=()=>{e.company.schema.status.length===0?K(!0):S(e)},he=()=>{R?.(e)},fe=d?.userRoles?.includes("admin"),be=e.company.company.configInfo.isMonthEndReportInDraft,W=J.canSendMonthEndEmailReport(e,r),ee=J.shouldEnableCalendarPickerForLastReportSent(e,r),ge=e.company.company.companyInfo.bookCloseDate,ve=e.company.company.managementInfo.lastReportSentDate,Re=e.taskSummary?.count??0,$=u.useCallback(()=>{O?.includes(t.NEW_THREAD_SUFFIX)===!0&&ie(O),m!=null&&b(void 0)},[m,O,ie,b]),Ce=u.useCallback(_=>{if(_===O)N(null);else if(z.has(_))N(_);else if(_.includes(t.NEW_THREAD_SUFFIX)){const[pe,ye]=_.replace(t.NEW_THREAD_SUFFIX,"").split("."),ke=Wt(Rt(pe),J.toManagementSortKeyType(ye),M,Y);Z(_,{type:"thread",id:_,roomId:w,createdAt:new Date,updatedAt:new Date,comments:[],metadata:ke,resolved:!1}),N(_)}},[M,Y,O,z,Z,N,w]),ae=u.useCallback((_,pe,ye=!1)=>{const ke=Ct.find(ue=>ue.key===pe);if(g(),ke!=null&&(_.type==="contextmenu"||ye===!0)){if(ke.isThreadAllowed===!1)return;$(),_.preventDefault(),_.stopPropagation();const ue=t.toCollaborationEntityType({tab:"management",key:ke.key});if(_.target instanceof HTMLElement||_.target instanceof SVGElement)if(ye===!0&&_.target instanceof HTMLElement)v(_.target.parentElement);else if(_.target instanceof HTMLElement){const Pe=Ss(_.target,oe);v(Pe||_.target)}else{const Pe=_.target.closest(`.${oe}`);Pe instanceof HTMLElement&&v(Pe)}const U=[...t.getFilteredThreads(z,{entityType:ue,companyId:M},"both")],Oe=U.length>0&&U[0].length>0?U[0][0]:Le("management",ke.key,M);z.has(Oe)?Ce(Oe):m===Oe?b(void 0):(b(Oe),N(null))}},[z,M,m,Ce,b,N,g,$]),ce=u.useCallback((_,pe)=>{_.stopPropagation();const ye=Le("management",pe,M);b(void 0),Ce(ye)},[M,b,Ce]),$e=()=>{re.reportSent.date!=null&&I(M,re.reportSent.date)},V=_=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:_.isElementThreadOpen??!1,isElementThreadPresent:_.isElementThreadPresent??!1,itemKey:_.itemKey,elementThreadId:_.elementThreadId??"",roomId:w,addThreadRequestThreadId:m,openThreadId:O,threadStyle:_.threadStyle,openThreadMetadata:H?.metadata??null,onElementClick:ae,onAddThreadClick:ce,targetElement:x??A});return o.jsxRuntimeExports.jsxs(o.FormProvider,{...F,children:[D===!0?o.jsxRuntimeExports.jsx(gd,{companyDomain:e.company.company.companyInfo.primaryEmailDomain,hasAdminRole:fe,onCancelClick:()=>K(!1),onConnectClick:()=>S(e)}):null,o.jsxRuntimeExports.jsx("form",{style:{height:"100%"},children:o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{g(),m!=null&&(b(void 0),m.includes(t.NEW_THREAD_SUFFIX)&&ie(m))},children:o.jsxRuntimeExports.jsx(Lp,{windowSize:T,hoverParentSubsidiaryTag:i??!1,isThreadOpen:L||se,totalHeight:c,isCreationInProgress:Q,children:Ct.map((_,pe)=>{const ye=t.toCollaborationEntityType({tab:"management",key:_.key}),ke=Ct.length-2<=pe,ue=[...t.getFilteredThreads(z,{entityType:ye,companyId:M},"both")],U=ue.length>0&&ue[0].length>0?ue[0][0]:Le("management",_.key,M),Oe=z.get(U),Pe=Oe!=null&&Oe.resolved===!1,Be=U===O,me=m===U;switch(_.key){case"companyName":return o.jsxRuntimeExports.jsxs(Op,{companyNameSticky:l,columnWidth:_.width,windowSize:T,isThreadOpen:Be||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),ref:q=>{j(M,_.key,q)},children:[o.jsxRuntimeExports.jsxs(Ap,{children:[o.jsxRuntimeExports.jsx(Dp,{className:"company-name",onClick:q=>{q.preventDefault(),q.stopPropagation(),te()},children:re.companyName}),re.parentSubsidiaryInfo&&o.jsxRuntimeExports.jsx(zc,{companyId:re.companyId,isEnabled:i,onViewDetailsLinkClicked:E,companyName:re.companyName,parentSubsidiaryRelationship:re.parentSubsidiaryInfo}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:Be,targetElement:x??A,roomId:w,openThreadId:O,openThreadMetadata:H?.metadata??null})]}),o.jsxRuntimeExports.jsxs(Np,{children:[o.jsxRuntimeExports.jsxs(Fp,{onClick:q=>{q.preventDefault(),h({roomId:w,companyId:M,companyName:Y,entityType:P})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:B.length,isLoading:k}),o.jsxRuntimeExports.jsx(Bp,{})]}),o.jsxRuntimeExports.jsx(Mp,{onClick:q=>{q.preventDefault(),y(e)},children:o.jsxRuntimeExports.jsx(zp,{className:"passportIcon"})})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:Pe,itemKey:_.key,style:{left:t.Space.sp4},onElementClick:ae}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Le("management",_.key,M),addThreadRequestThreadId:m,itemKey:_.key,onAddThreadClick:ce})]},U);case"task":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{j(M,_.key,q)},columnWidth:_.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),children:[o.jsxRuntimeExports.jsxs(_p,{onClick:q=>{q.preventDefault(),f?.(e)},children:[o.jsxRuntimeExports.jsx(Wp,{}),Re>0?o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{isLoading:!1,count:Re}):null]}),V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"status":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{j(M,_.key,q)},columnWidth:_.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),children:[o.jsxRuntimeExports.jsx(td,{name:"companyData.status",value:re.status}),V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"group":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{j(M,_.key,q)},columnWidth:_.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),children:[o.jsxRuntimeExports.jsx(vd,{name:"companyData.group",value:re.group}),V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"plans":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{j(M,_.key,q)},columnWidth:_.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),children:[o.jsxRuntimeExports.jsx(Cd,{chips:re.plansAndAddons}),V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"satisfaction":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{j(M,_.key,q)},windowSize:T,columnWidth:_.width,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),children:[o.jsxRuntimeExports.jsx(xp,{name:"companyData.customerSatisfaction",value:re.customerSatisfaction}),V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"bookCloseDate":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{j(M,_.key,q)},columnWidth:_.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),children:[ge?.format(ki.visual.MMMDCommaYYYYformat)??bo.strings.hyphen,V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"reportSent":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{j(M,_.key,q)},columnWidth:_.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),style:{alignItems:"center"},children:[ee&&o.jsxRuntimeExports.jsx(Ip,{children:o.jsxRuntimeExports.jsx(t.ZeniDatePickerField,{name:"companyData.reportSent",defaultValue:re.reportSent})}),!ee&&o.jsxRuntimeExports.jsx(kp,{reportSent:re.reportSent,onReportSentClick:$e,hasMonthEndEmailHistory:n}),o.jsxRuntimeExports.jsx(Pp,{children:p?o.jsxRuntimeExports.jsx(Xp,{isMonthEndReportInDraft:be,bookCloseDate:ge,lastReportSentDate:ve,enableCompanyMonthEndReportBtn:W,handleMonthEndReportPageClick:he}):o.jsxRuntimeExports.jsx(ls,{isMonthEndReportInDraft:be,bookCloseDate:ge,lastReportSentDate:ve,enableCompanyMonthEndReportBtn:W,isExpenseAutomationEnabledForUser:p,handleMonthEndReportPageClick:he})}),V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"customerSuccessManager":case"preparer":case"reviewer":case"apAnalyst":case"controller":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{j(M,_.key,q)},columnWidth:_.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),children:[o.jsxRuntimeExports.jsx(t.UserMultiSelectField,{name:`companyData.${_.key}`,value:re[_.key],placeholderLabel:Us[_.key],pickerStyles:{titleTextStyle:t.textStyles.largeRegular,multiValueLabelTitleStyle:t.textStyles.largeRegular}}),V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"taxStatus":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{j(M,_.key,q)},columnWidth:_.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),children:[o.jsxRuntimeExports.jsx(yp,{name:"companyData.taxStatus",value:re.taxStatus}),V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"taxLead":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{j(M,_.key,q)},columnWidth:_.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),children:[o.jsxRuntimeExports.jsx(t.UserMultiSelectField,{name:"companyData.taxLead",value:re.taxLead,placeholderLabel:Us.taxLead,pickerStyles:{titleTextStyle:t.textStyles.largeRegular,multiValueLabelTitleStyle:t.textStyles.largeRegular}}),V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"monthlyRecurringRevenue":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{j(M,_.key,q)},columnWidth:_.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),children:[t.amountToString("0,0",re.monthlyRecurringRevenue),V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"annualRecurringRevenue":return o.jsxRuntimeExports.jsxs(tt,{ref:q=>{j(M,_.key,q)},columnWidth:_.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,_.key),children:[t.amountToString("0,0",re.annualRecurringRevenue),V({isElementThreadOpen:Be,isElementThreadPresent:Pe,itemKey:_.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);default:return null}})})})})]})},ls=({enableCompanyMonthEndReportBtn:e,isMonthEndReportInDraft:n,isExpenseAutomationEnabledForUser:r,bookCloseDate:i,lastReportSentDate:a,handleMonthEndReportPageClick:d})=>o.jsxRuntimeExports.jsx(t.Button,{size:"small",onClick:d,variant:"primary",label:Zp(e,n,i,a),disabled:!e||r,style:e?{}:{background:"transparent"},prefixIcon:e&&n?o.jsxRuntimeExports.jsx(Vp,{}):void 0}),Lp=s.div`
|
|
781
781
|
display: flex;
|
|
782
782
|
flex-direction: row;
|
|
783
783
|
align-items: center;
|
|
@@ -1004,7 +1004,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
1004
1004
|
width: ${e=>e.width.valuePx(e.windowSize)};
|
|
1005
1005
|
display: flex;
|
|
1006
1006
|
justify-content: start;
|
|
1007
|
-
`,lu={managementRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{common:{headers:{comments:cu}},collaboration:{threads:{placeholder:{addANewComment:du,replyAComment:pu},tooltip:{resolveComment:uu,unResolveComment:mu}}},dateFormat:{analytics:{YYYYDashMMDashDDFormat:Ks}}}=t.appLocale.getLocalizedStrings(),xu=({managementView:e,companiesExcludedFromMonthEndReport:n,showDetailsPageLink:r=!0,loggedInUser:i,loggedInUserRole:a,expenseAutomationEnabledCompanies:d,onColumnSortConfigChanged:l,changeHandlers:c,onCompanyNameClicked:p,onTaskIconClicked:m,onPassportIconClicked:x,onScroll:
|
|
1007
|
+
`,lu={managementRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{common:{headers:{comments:cu}},collaboration:{threads:{placeholder:{addANewComment:du,replyAComment:pu},tooltip:{resolveComment:uu,unResolveComment:mu}}},dateFormat:{analytics:{YYYYDashMMDashDDFormat:Ks}}}=t.appLocale.getLocalizedStrings(),xu=({managementView:e,companiesExcludedFromMonthEndReport:n,showDetailsPageLink:r=!0,loggedInUser:i,loggedInUserRole:a,expenseAutomationEnabledCompanies:d,onColumnSortConfigChanged:l,changeHandlers:c,onCompanyNameClicked:p,onTaskIconClicked:m,onPassportIconClicked:x,onScroll:g,onViewDetailsLinkClicked:h,onMonthEndReportPageClick:j,showMonthEndReportHistoricData:b,initialOpenThreadRequest:C})=>{const S=t.useWindowSizeContext(),y=u.useRef(null),[f,E]=u.useState(null),[R,I]=u.useState(null),{setOpenThread:A,setRequestToOpenThread:v,requestToOpenThread:T,isLoading:F}=u.useContext(t.ThreadsContext);u.useEffect(()=>{C!=null&&e.fetchState==="Completed"&&F===!1&&v(C)},[C,e.fetchState,F,v]);const[D,K]=u.useState(void 0),M=u.useRef(null),Y=u.useRef([]),G=!(S==="small"||S==="medium-compact"),{uiState:w,totalAnnualRecurringRevenue:P,totalMonthlyRecurringRevenue:B}=e,k=w.scrollYOffset??0,O=u.useCallback((N,H,L)=>{const Q=e.companies.findIndex(X=>X.company.company.companyInfo.companyId===N),se=Ct.findIndex(X=>X.key===H);Q!==-1&&se!==-1&&(Y.current[Q]==null?Y.current[Q]=[L]:Y.current[Q][se]=L)},[e.companies]),z=u.useCallback(N=>{let H=e.companies[N].company.company.companyInfo.name.length;const L=e.companies[N].company.company.parentSubsidiaryInfo;return L.parentInfo?H+=10:L.subsidiaryInfo&&(H+=15),H>_t?Ie+32:Ie},[e.companies]),Z=u.useCallback(()=>{M.current=null,v(null)},[v]);u.useEffect(()=>{y.current&&y.current.resetAfterIndex(0)},[e]),u.useEffect(()=>{if(T!=null&&f!=null){const{companyId:N,entityType:H}=T,[L,Q]=H.split("."),se=e.companies.findIndex(he=>he.company.company.companyInfo.companyId===N),X=Ct.findIndex(he=>he.key===Q);se!==-1&&!(f.visibleStartIndex<=se&&f.visibleStopIndex>=se)&&y.current?.scrollToItem(se,"center"),setTimeout(()=>{const fe=Y.current[se]?.[X];fe!=null&&(M.current={companyId:N,target:fe});const be=Y.current[se]?.[0]?.getBoundingClientRect().bottom,W=Y.current[se]?.[0]?.getBoundingClientRect().top;if(be!=null&&W!=null&&(window.innerHeight>=be&&window.innerHeight>=W||W<0)){const ee=Y.current[se][X];ee!=null&&(M.current={companyId:N,target:ee}),Y.current[se][X]?.scrollIntoView({block:"center",behavior:"auto"})}},0);const te=setInterval(()=>{const he=Y.current[se]?.[X]?.getBoundingClientRect().left,fe=Y.current[se]?.[X]?.getBoundingClientRect().right,be=Y.current[se]?.[X]?.offsetWidth;if(M.current?.companyId===N&&he!=null&&be!=null&&fe!=null&&(he<window.innerWidth-be||fe<window.innerWidth)){clearInterval(te);const W=T.threadId,ee=T.onThreadShownCallback;W&&(v(null),A(T.threadId),ee?.())}},500);setTimeout(()=>{clearInterval(te),v(null)},2e3)}},[T,f,A,v]);const ie=u.useMemo(()=>({makeCompanyNameSticky:G,uiState:w,totalAnnualRecurringRevenue:P,totalMonthlyRecurringRevenue:B,onColumnSortConfigChanged:l}),[G,w,P,B,l]);return o.jsxRuntimeExports.jsx(gu,{children:o.jsxRuntimeExports.jsxs(Ti.Provider,{value:ie,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:N,width:H})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:N,innerElementType:Li,itemCount:e.companies.length,itemSize:z,onItemsRendered:L=>E(L),itemData:{managementView:e,loggedInUser:i,loggedInUserRole:a,showDetailsPageLink:r,makeCompanyNameSticky:G,companiesExcludedFromMonthEndReport:n,addThreadRequestThreadId:D,expenseAutomationEnabledCompanies:d,targetElement:M.current?.target,resetTargetElementFromNavigation:Z,setElementRef:O,onCompanyNameClicked:p,onPassportIconClicked:x,onTaskIconClicked:m,onMonthEndReportPageClick:j,setAddThreadRequestThreadId:K,changeHandlers:c,setNoteData:I,onViewDetailsLinkClicked:h,showMonthEndReportHistoricData:b},width:H,ref:y,overscanCount:Bt,onScroll:({scrollOffset:L})=>{g?.(L)},initialScrollOffset:k??0,children:hu})}),R!=null?o.jsxRuntimeExports.jsx(Xe.RoomProvider,{id:R.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${R.companyName} ${cu}`,filter:{application:"cockpit",companyId:R.companyId,entityType:R.entityType,isGlobalComment:!1,tab:"management"},isLoading:!1,threadMetadata:{companyName:R.companyName,companyId:R.companyId,entityId:R.companyId,entityType:R.entityType,isGlobalComment:!1,application:"cockpit",tab:"management",url:window.location.href},textOverrides:{composerPlaceholder:du,replyComposerPlaceholder:pu,threadResolve:uu,threadUnResolve:mu},onThreadClick:N=>null,onCloseAllThreadsDrawer:()=>I(null)})}):null]})})},Ti=u.createContext(void 0),hu=({index:e,style:n,data:r})=>{const i=t.useWindowSizeContext(),{loggedInUserRole:a,showDetailsPageLink:d,addThreadRequestThreadId:l,targetElement:c,setNoteData:p,managementView:m,resetTargetElementFromNavigation:x,setElementRef:g,companiesExcludedFromMonthEndReport:h,makeCompanyNameSticky:j,changeHandlers:b,expenseAutomationEnabledCompanies:C,onCompanyNameClicked:S,onPassportIconClicked:y,onTaskIconClicked:f,onMonthEndReportPageClick:E,onViewDetailsLinkClicked:R,setAddThreadRequestThreadId:I,showMonthEndReportHistoricData:A}=r,v=m.companies[e],{companyId:T}=v.company.company.companyInfo,F=C.includes(T);return o.jsxRuntimeExports.jsx(yu,{style:{...n,width:"fit-content",minWidth:"100%",padding:`${t.Space.sp0} ${lu.managementRightPadding.valuePx(i)} ${t.Space.sp3} ${t.Space.sp0}`},children:o.jsxRuntimeExports.jsx(Tp,{onViewDetailsLinkClicked:R,showDetailsPageLink:d,loggedInUserRole:a,addThreadRequestThreadId:l,targetElementFromNavigation:c,resetTargetElementFromNavigation:x,setNoteData:p,setElementRef:g,isExpenseAutomationEnabledForUser:F,totalHeight:typeof n.height=="number"?n.height:Ie,changeHandlers:b,companyView:m.companies[e],hasMonthEndEmailHistory:m.companies[e].hasMonthEndEmailHistory,allUsers:m.zeniUsers.values,companyNameSticky:j,onCompanyNameClicked:S,onPassportIconClicked:y,onTaskIconClicked:f,onMonthEndReportPageClick:E,setAddThreadRequestThreadId:I,companiesExcludedFromMonthEndReport:h,showMonthEndReportHistoricData:A})},T)},Li=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,totalAnnualRecurringRevenue:c,totalMonthlyRecurringRevenue:p,onColumnSortConfigChanged:m}=u.useContext(Ti);return o.jsxRuntimeExports.jsxs(Su,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(Qp,{companyNameSticky:d,onColumnSortConfigChanged:m,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder}}),o.jsxRuntimeExports.jsx(fu,{children:r}),o.jsxRuntimeExports.jsx(ru,{companyNameSticky:d,totalMRRAmount:t.amountToString("0,0",p),totalARRAmount:t.amountToString("0,0",c)})]})});Li.displayName="Management list view inner element type";const gu=s.div`
|
|
1008
1008
|
/** Subtract top so list can occupy remaining available height */
|
|
1009
1009
|
height: calc(100vh - 110px);
|
|
1010
1010
|
max-width: 99.9%;
|
|
@@ -1034,7 +1034,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
1034
1034
|
height: calc(100vh - 45px);
|
|
1035
1035
|
overflow-y: hidden;
|
|
1036
1036
|
background-color: ${e=>e.theme.colors.grey4};
|
|
1037
|
-
`,wu=({companiesExcludedFromMonthEndReport:e,headerData:n,headerActions:r,managementPageActions:i,managementPageData:a,expenseAutomationEnabledCompanies:d,initialOpenThreadRequest:l})=>{const{managementView:c,loggedInUser:p,loggedInUserRole:m,showDetailsPageLink:x}=a,{onColumnSortConfigChanged:
|
|
1037
|
+
`,wu=({companiesExcludedFromMonthEndReport:e,headerData:n,headerActions:r,managementPageActions:i,managementPageData:a,expenseAutomationEnabledCompanies:d,initialOpenThreadRequest:l})=>{const{managementView:c,loggedInUser:p,loggedInUserRole:m,showDetailsPageLink:x}=a,{onColumnSortConfigChanged:g,changeHandlers:h,onScroll:j,onViewDetailsLinkClicked:b,onCockpitReloadData:C,onCompanyNameClicked:S,onPassportIconClicked:y,onTaskIconClicked:f,onFiltersChange:E,onMonthEndReportPageClick:R,showMonthEndReportHistoricData:I}=i,A=c.uiState.filterText,v=c.uiState.filters,T=c.fetchState==="Completed"&&c.zeniUsers.fetchState==="Completed";return r.filterActions&&(r.filterActions.getCategoryWiseOptions=()=>ku(c)),o.jsxRuntimeExports.jsxs(Eu,{children:[o.jsxRuntimeExports.jsx(dt,{headerActions:{...r},headerData:{...n,filterData:{filterText:A,filters:v},companiesLoaded:T,selectedTabOption:"management",allTabOptions:x===void 0?n.allTabOptions??rt:void 0}}),o.jsxRuntimeExports.jsx(vu,{changeHandlers:h,companiesExcludedFromMonthEndReport:e,expenseAutomationEnabledCompanies:d,initialOpenThreadRequest:l,isFilterApplied:v?.categories!=null,loggedInUser:p,loggedInUserRole:m,managementView:c,onClearFilter:()=>E?.("management",{}),onCockpitReloadData:C,onColumnSortConfigChanged:g,onCompanyNameClicked:S,onMonthEndReportPageClick:R,onPassportIconClicked:y,onScroll:j,onTaskIconClicked:f,onViewDetailsLinkClicked:b,showMonthEndReportHistoricData:I})]})},vu=({managementView:e,showDetailsPageLink:n=!0,loggedInUser:r,companiesExcludedFromMonthEndReport:i,expenseAutomationEnabledCompanies:a,initialOpenThreadRequest:d,isFilterApplied:l,loggedInUserRole:c,onColumnSortConfigChanged:p,changeHandlers:m,onScroll:x,onViewDetailsLinkClicked:g,onCockpitReloadData:h,onCompanyNameClicked:j,onTaskIconClicked:b,onPassportIconClicked:C,onClearFilter:S,onMonthEndReportPageClick:y,showMonthEndReportHistoricData:f})=>{const E=t.useWindowSizeContext();return e.fetchState==="Error"||e.zeniUsers.fetchState==="Error"?o.jsxRuntimeExports.jsx($t,{onCockpitReloadData:h,selectedCockpitOption:"management"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"||e.zeniUsers.fetchState==="In-Progress"||e.zeniUsers.fetchState==="Not-Started"?o.jsxRuntimeExports.jsx(Ru,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})}):e.companies.length===0?l?o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchOnFilters,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine,filtersApplied:!0,onClearFilter:S}):o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextFirstLine,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine}):o.jsxRuntimeExports.jsx($u,{windowSize:E,children:o.jsxRuntimeExports.jsx(bu,{showDetailsPageLink:n,onColumnSortConfigChanged:p,changeHandlers:m,onScroll:x,onViewDetailsLinkClicked:g,managementView:e,loggedInUser:r,loggedInUserRole:c,expenseAutomationEnabledCompanies:a,onCompanyNameClicked:j,onTaskIconClicked:b,onPassportIconClicked:C,onMonthEndReportPageClick:y,companiesExcludedFromMonthEndReport:i,showMonthEndReportHistoricData:f,initialOpenThreadRequest:d})})},ku=e=>{const n=e.zeniUsers.values,r=hi,{companies:i}=e;return r.reduce((a,d)=>{switch(d.value){case"companyGroupId":{if(i.length===0)return{...a,[d.value]:[]};const l=i[0].company.schema.companyGroup.map(c=>{const p=c;return{label:p.name,value:p.id}});return{...a,[d.value]:l}}case"statusCode":{if(i.length===0)return{...a,[d.value]:[]};const l=i[0].company.schema.status.map(c=>{const p=c;return{label:p.name,value:p.code}});return{...a,[d.value]:l}}case"taxStatusCode":{if(i.length===0)return{...a,[d.value]:[]};const l=i[0].company.schema.taxStatus.map(c=>{const p=c;return{label:p.name,value:p.code,avatar:""}});return{...a,[d.value]:l}}case"controllerUserIds":case"apAnalystUserIds":case"preparerUserIds":case"reviewerUserIds":case"taxLeadUserIds":case"customerSuccessManagerUserIds":{const l=n.map(c=>({label:c.firstName||c.lastName?`${c.firstName} ${c.lastName}`:c.email,value:c.userId,photo:c.photo,email:c.email}));return{...a,[d.value]:l}}case"plans":{const l=e.subscriptionPlansZeniSkus.map(c=>({label:c,value:c})).sort((c,p)=>c.label.localeCompare(p.label));return{...a,[d.value]:l}}case"annualRecurringRevenue":return{...a,[d.value]:Qa};case"monthlyRecurringRevenue":return{...a,[d.value]:hs};case"customerSatisfaction":{const l=Object.values(To).map(c=>({label:c.name,value:c.id}));return{...a,[d.value]:l}}case"zeniSatisfaction":{const l=Object.values(eo).map(c=>({label:c.name,value:c.id}));return{...a,[d.value]:l}}default:return{...a,[d.value]:[]}}},{})},Gs=t.appLocale.getLocalizedStrings().cockpit.taskManager.header,{common:Ht}=t.appLocale.getLocalizedStrings(),Ot=[{key:"name",value:Ht.texts.name,sortOrder:"ascending",width:new t.ResponsiveSized(176,176),isThreadAllowed:!0},{key:"taskName",value:Gs.taskName,sortOrder:"ascending",width:new t.ResponsiveSized(320,320),isThreadAllowed:!0},{key:"status",value:Ht.texts.status,sortOrder:"ascending",width:new t.ResponsiveSized(100,100),isThreadAllowed:!0},{key:"priority",value:Ht.texts.priority,sortOrder:"ascending",width:new t.ResponsiveSized(90,90),isThreadAllowed:!0},{key:"dueDate",value:Ht.texts.dueDate,sortOrder:"ascending",width:new t.ResponsiveSized(100,100),isThreadAllowed:!0},{key:"assignee",value:Ht.texts.assignee,sortOrder:"ascending",width:new t.ResponsiveSized(220,220),isThreadAllowed:!0},{key:"tags",value:Gs.tags,sortOrder:"ascending",width:new t.ResponsiveSized(115,115),isThreadAllowed:!0},{key:"createdBy",value:Ht.texts.createdBy,sortOrder:"ascending",width:new t.ResponsiveSized(140,140),isThreadAllowed:!0}];Ot.map(e=>e.key);function Tu({sortConfig:e,onColumnSortConfigChanged:n}){const r=t.useWindowSizeContext(),[i,a]=u.useState(o.cloneDeep(Ot));u.useEffect(()=>{const l=[...i];for(const c of l)c.key===e.sortKey?c.sortOrder=e.sortOrder:c.sortOrder="ascending";a(l)},[e.sortKey,e.sortOrder]);const d=(l,c)=>{let p=c;e.sortKey===l&&(p=c==="ascending"?"descending":"ascending"),n(l,p)};return o.jsxRuntimeExports.jsx(Pu,{height:Ft,children:i.map(l=>o.jsxRuntimeExports.jsxs(Iu,{sortDataValue:e.sortKey,actualDataValue:l.key,wrapperWidth:l.width,windowSize:r,children:[o.jsxRuntimeExports.jsxs(Ou,{onClick:()=>d(J.toTaskManagerSortKeyType(l.key),l.sortOrder),children:[o.jsxRuntimeExports.jsx(t.ExtraSmallRegular,{children:l.value}),o.jsxRuntimeExports.jsx(Lu,{sortDataValue:e.sortKey,headerdata:l,children:o.jsxRuntimeExports.jsx(t.SvgArrowTailTop,{width:12,height:12})})]}),o.jsxRuntimeExports.jsx(Du,{isVisible:e.sortKey===l.key&&l.key!=="dueDate",children:o.jsxRuntimeExports.jsx(Au,{onClick:()=>d("dueDate","ascending")})})]},l.key))})}const Lu=s.div`
|
|
1038
1038
|
display: flex;
|
|
1039
1039
|
align-items: center;
|
|
1040
1040
|
transform: ${e=>e.sortDataValue===e.headerdata.key&&e.headerdata.sortOrder==="descending"?"rotate(180deg)":"rotate(0deg)"};
|
|
@@ -1091,7 +1091,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
1091
1091
|
&:hover {
|
|
1092
1092
|
color: ${e=>e.theme.colors.primary};
|
|
1093
1093
|
}
|
|
1094
|
-
`,{dateFormat:Nu,common:{strings:{empty:jn,hyphen:Mu,plus:Io}}}=t.appLocale.getLocalizedStrings(),zu=({totalHeight:e,task:n,addThreadRequestThreadId:r,setElementRef:i,setAddThreadRequestThreadId:a,onRowClick:d})=>{const l=t.useWindowSizeContext(),c=o.useTheme(),p=n.assignees.length>0?n.assignees[0]:void 0,m=p?.firstName!=null&&p?.lastName!=null?`${p.firstName} ${p.lastName}`:p?.email??jn,{companyId:x,name:
|
|
1094
|
+
`,{dateFormat:Nu,common:{strings:{empty:jn,hyphen:Mu,plus:Io}}}=t.appLocale.getLocalizedStrings(),zu=({totalHeight:e,task:n,addThreadRequestThreadId:r,setElementRef:i,setAddThreadRequestThreadId:a,onRowClick:d})=>{const l=t.useWindowSizeContext(),c=o.useTheme(),p=n.assignees.length>0?n.assignees[0]:void 0,m=p?.firstName!=null&&p?.lastName!=null?`${p.firstName} ${p.lastName}`:p?.email??jn,{companyId:x,name:g}=n.company.companyInfo,h=n.createdByUser?.firstName!==null&&n.createdByUser?.lastName!=null?`${n.createdByUser.firstName} ${n.createdByUser.lastName}`:n.createdByUser?.email??jn,j=n.assignees.length,b=n.task.id,{openThread:C,threads:S,addThread:y,removeThread:f,setOpenThread:E,setRequestToOpenThread:R}=u.useContext(t.ThreadsContext),I=C!==null?S.get(C):null,A=C?.includes(x)===!0,v=C!=null&&S.get(C)==null&&A,T=r!=null&&S.get(r)?.metadata.companyId===x,F=`cockpit_${x}`,D=u.useCallback(()=>{C?.includes(t.NEW_THREAD_SUFFIX)===!0&&f(C),r!=null&&a(void 0)},[r,C,f,a]),K=w=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:w.isElementThreadOpen??!1,isElementThreadPresent:w.isElementThreadPresent??!1,itemKey:w.itemKey,elementThreadId:w.elementThreadId??"",roomId:F,addThreadRequestThreadId:r,openThreadId:C,threadStyle:w.threadStyle,openThreadMetadata:I?.metadata??null,onElementClick:Y,onAddThreadClick:G}),M=u.useCallback(w=>{if(w===C)E(null);else if(S.has(w))E(w);else if(w.includes(t.NEW_THREAD_SUFFIX)){const[P,B]=w.replace(t.NEW_THREAD_SUFFIX,"").split("."),k=Wt(Rt(P),J.toTaskManagerSortKeyType(B),x,g,b);y(w,{type:"thread",id:w,roomId:F,createdAt:new Date,updatedAt:new Date,comments:[],metadata:k,resolved:!1}),E(w)}},[C,S,E,x,g,b,y,F]),Y=u.useCallback((w,P,B=!1)=>{const k=Ot.find(O=>O.key===P);if(R(null),k!=null&&(w.type==="contextmenu"||B===!0)){if(k.isThreadAllowed===!1)return;D(),w.preventDefault(),w.stopPropagation();const O=t.toCollaborationEntityType({tab:"taskManager",key:k.key}),z=[...t.getFilteredThreads(S,{entityType:O,entityId:b,companyId:x},"both")],Z=z.length>0&&z[0].length>0?z[0][0]:Le("taskManager",k.key,x+Io+b);S.has(Z)?M(Z):r===Z?a(void 0):(a(Z),E(null))}},[S,b,x,r,M,a,E,R,D]),G=u.useCallback((w,P)=>{w.stopPropagation();const B=Le("taskManager",P,x+Io+b);a(void 0),M(B)},[x,b,a,M]);return o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{R(null),r!=null&&(a(void 0),r.includes(t.NEW_THREAD_SUFFIX)&&f(r))},children:o.jsxRuntimeExports.jsx(Fu,{onClick:()=>d(n.company.companyInfo.primaryEmailDomain,n.task.id),windowSize:l,isThreadOpen:A||T,totalHeight:e,isCreationInProgress:v,children:Ot.map((w,P)=>{const B=t.toCollaborationEntityType({tab:"taskManager",key:w.key}),k=Ot.length-2<=P,O=[...t.getFilteredThreads(S,{entityType:B,entityId:b,companyId:x},"both")],z=O.length>0&&O[0].length>0?O[0][0]:Le("taskManager",w.key,x+Io+b),Z=S.get(z),ie=Z!=null&&Z.resolved===!1,N=z===C,H=L=>J.allTaskPriority.find(Q=>Q.code===L)?.name??jn;switch(w.key){case"name":return o.jsxRuntimeExports.jsxs(yt,{ref:L=>{i(x,w.key,L)},columnWidth:w.width,windowSize:l,isThreadAllowed:w.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,w.key),children:[o.jsxRuntimeExports.jsx(Bu,{children:n.company.companyInfo.name}),K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:w.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);case"taskName":return o.jsxRuntimeExports.jsxs(yt,{ref:L=>{i(x,w.key,L)},columnWidth:w.width,windowSize:l,isThreadAllowed:w.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,w.key),children:[o.jsxRuntimeExports.jsx(t.StandardRegular,{children:n.task.name}),K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:w.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);case"status":return o.jsxRuntimeExports.jsxs(yt,{ref:L=>{i(x,w.key,L)},columnWidth:w.width,windowSize:l,isThreadAllowed:w.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,w.key),children:[t.getRichLabel(n.task.status.code,c),K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:w.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);case"priority":return o.jsxRuntimeExports.jsxs(yt,{ref:L=>{i(x,w.key,L)},columnWidth:w.width,windowSize:l,isThreadAllowed:w.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,w.key),children:[o.jsxRuntimeExports.jsxs(Wu,{children:[o.jsxRuntimeExports.jsx(Vu,{color:t.getLabelColor(n.task.priority.code,c)}),o.jsxRuntimeExports.jsx(t.StandardRegular,{children:H(n.task.priority.code)})]}),K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:w.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);case"dueDate":return o.jsxRuntimeExports.jsxs(yt,{ref:L=>{i(x,w.key,L)},columnWidth:w.width,windowSize:l,isThreadAllowed:w.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,w.key),children:[o.jsxRuntimeExports.jsx(t.StandardRegular,{children:n.task.dueDate!=null?n.task.dueDate.format(Nu.visual.MMMDCommaYYYYformat):Mu}),K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:w.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);case"assignee":return o.jsxRuntimeExports.jsxs(yt,{ref:L=>{i(x,w.key,L)},columnWidth:w.width,windowSize:l,isThreadAllowed:w.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,w.key),children:[o.jsxRuntimeExports.jsx(t.ZeniAvatar,{personBasic:p,styles:{width:t.Space.sp4,height:t.Space.sp4}}),o.jsxRuntimeExports.jsx(Ys,{children:m}),j>1?o.jsxRuntimeExports.jsx(_u,{children:o.jsxRuntimeExports.jsx(t.SmallRegular,{children:`${Io}${j-1}`})}):null,K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:w.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);case"tags":return o.jsxRuntimeExports.jsxs(yt,{ref:L=>{i(x,w.key,L)},columnWidth:w.width,windowSize:l,isThreadAllowed:w.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,w.key),children:[n.task.tagIds.length>0?o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:t.getTagLabel(n.task.tagIds,n.tags)}):null,K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:w.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);case"createdBy":return o.jsxRuntimeExports.jsxs(yt,{ref:L=>{i(x,w.key,L)},columnWidth:w.width,windowSize:l,isThreadAllowed:w.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,w.key),children:[o.jsxRuntimeExports.jsx(t.ZeniAvatar,{personBasic:n.createdByUser,styles:{width:t.Space.sp4,height:t.Space.sp4}}),o.jsxRuntimeExports.jsx(Ys,{children:h}),K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:w.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);default:return null}})})})},Fu=s.div`
|
|
1095
1095
|
display: flex;
|
|
1096
1096
|
min-width: 100%;
|
|
1097
1097
|
flex-direction: row;
|
|
@@ -1178,7 +1178,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
1178
1178
|
height: ${t.Space.sp3};
|
|
1179
1179
|
color: ${e=>e.color};
|
|
1180
1180
|
margin-right: ${t.Space.sp2};
|
|
1181
|
-
`,Pi=u.createContext(void 0),Ii=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{uiState:d,onColumnSortConfigChanged:l}=u.useContext(Pi);return o.jsxRuntimeExports.jsxs(Ai,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(Tu,{onColumnSortConfigChanged:l,sortConfig:{sortKey:d.sortKey,sortOrder:d.sortOrder}}),o.jsxRuntimeExports.jsx(Ku,{children:r})]})});Ii.displayName="Task manager list view inner element type";const Uu=({companyTaskManagerView:e,fetchNextItemsOnScroll:n,onColumnSortConfigChanged:r,onRowClick:i,initialOpenThreadRequest:a})=>{const{uiState:d,fetchState:l}=e,c=u.useRef(null),[p,m]=u.useState(null),x=u.useMemo(()=>({uiState:e.uiState,onColumnSortConfigChanged:r}),[e.uiState,r]),{setOpenThread:
|
|
1181
|
+
`,Pi=u.createContext(void 0),Ii=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{uiState:d,onColumnSortConfigChanged:l}=u.useContext(Pi);return o.jsxRuntimeExports.jsxs(Ai,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(Tu,{onColumnSortConfigChanged:l,sortConfig:{sortKey:d.sortKey,sortOrder:d.sortOrder}}),o.jsxRuntimeExports.jsx(Ku,{children:r})]})});Ii.displayName="Task manager list view inner element type";const Uu=({companyTaskManagerView:e,fetchNextItemsOnScroll:n,onColumnSortConfigChanged:r,onRowClick:i,initialOpenThreadRequest:a})=>{const{uiState:d,fetchState:l}=e,c=u.useRef(null),[p,m]=u.useState(null),x=u.useMemo(()=>({uiState:e.uiState,onColumnSortConfigChanged:r}),[e.uiState,r]),{setOpenThread:g,setRequestToOpenThread:h,requestToOpenThread:j,isLoading:b}=u.useContext(t.ThreadsContext);u.useEffect(()=>{a!=null&&e.fetchState==="Completed"&&b===!1&&h(a)},[a,e.fetchState,b,h]);const[C,S]=u.useState(void 0),y=u.useRef([]),f=u.useCallback(A=>e.tasksList[A].company.companyInfo.name.length>_t?Ie+32:Ie,[e.tasksList]),E=u.useCallback(A=>A<e.tasksList.length,[e.tasksList.length]),R=u.useCallback(()=>{d.from!=null&&l==="Completed"&&n()},[n,l,d.from]);u.useEffect(()=>{c.current&&c.current.resetAfterIndex(0)},[e]);const I=u.useCallback((A,v,T)=>{const F=e.tasksList.findIndex(K=>K.company.companyInfo.companyId===A),D=Ot.findIndex(K=>K.key===v);F!==-1&&D!==-1&&(y.current[F]==null?y.current[F]=[T]:y.current[F][D]=T)},[e.tasksList]);return u.useEffect(()=>{if(j!=null&&p!=null){const{companyId:A,entityType:v}=j,[T,F]=v.split("."),D=e.tasksList.findIndex(G=>G.company.companyInfo.companyId===A),K=Ot.findIndex(G=>G.key===F);D!==-1&&!(p.visibleStartIndex<=D&&p.visibleStopIndex>=D)&&c.current?.scrollToItem(D,"center"),setTimeout(()=>{const G=y.current[D]?.[0]?.getBoundingClientRect().bottom,w=y.current[D]?.[0]?.getBoundingClientRect().top;G!=null&&w!=null&&(window.innerHeight>=G&&window.innerHeight>=w||w<0)&&y.current[D][K]?.scrollIntoView({block:"center",behavior:"auto"})},0);const Y=setInterval(()=>{const G=y.current[D]?.[K]?.getBoundingClientRect().left,w=y.current[D]?.[K]?.getBoundingClientRect().right,P=y.current[D]?.[K]?.offsetWidth;if(G!=null&&P!=null&&w!=null&&(G<window.innerWidth-P||w<window.innerWidth)){clearInterval(Y);const B=j.threadId,k=j.onThreadShownCallback;B&&(h(null),g(j.threadId),k?.())}},500);setTimeout(()=>{clearInterval(Y),h(null)},2e3)}},[j,p,g,h]),o.jsxRuntimeExports.jsx(Yu,{children:o.jsxRuntimeExports.jsx(Pi.Provider,{value:x,children:o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:A,width:v})=>o.jsxRuntimeExports.jsx(Ai,{style:{height:A,width:v},children:o.jsxRuntimeExports.jsx(o.InfiniteLoader,{isItemLoaded:E,itemCount:e.tasksList.length+1,loadMoreItems:R,children:({onItemsRendered:T})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:A,innerElementType:Ii,itemCount:e.tasksList.length,itemSize:f,itemData:{companyTaskManagerView:e,addThreadRequestThreadId:C,setElementRef:I,setAddThreadRequestThreadId:S,onRowClick:i},width:v,ref:c,onItemsRendered:F=>{m(F),T(F)},overscanCount:Bt,children:Hu})})})})})})},Hu=({index:e,style:n,data:r})=>{const i=r.companyTaskManagerView,{addThreadRequestThreadId:a,setElementRef:d,setAddThreadRequestThreadId:l,onRowClick:c}=r,p=i.tasksList[e];return o.jsxRuntimeExports.jsx(Gu,{style:{...n,width:"fit-content",minWidth:"100%"},children:o.jsxRuntimeExports.jsx(zu,{totalHeight:typeof n.height=="number"?n.height:Ie,addThreadRequestThreadId:a,setElementRef:d,setAddThreadRequestThreadId:l,task:p,onRowClick:c})},p.task.id)},Ai=s.div``,Ku=s.div`
|
|
1182
1182
|
position: relative;
|
|
1183
1183
|
width: auto;
|
|
1184
1184
|
height: 100%;
|
|
@@ -1192,7 +1192,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
1192
1192
|
min-height: 100%;
|
|
1193
1193
|
flex-direction: column;
|
|
1194
1194
|
width: 100%;
|
|
1195
|
-
`,{cockpit:cs}=t.appLocale.getLocalizedStrings(),Zu=({headerActions:e,headerData:n,isBirdsEyeViewEnabled:r,initialOpenThreadRequest:i,taskManagerPageData:a,taskManagerPageActions:d})=>{const{companyTaskManagerView:l}=a,{uiState:c}=l,{onCockpitReloadData:p,onFetchTaskManagerView:m,onRowClick:x}=d,
|
|
1195
|
+
`,{cockpit:cs}=t.appLocale.getLocalizedStrings(),Zu=({headerActions:e,headerData:n,isBirdsEyeViewEnabled:r,initialOpenThreadRequest:i,taskManagerPageData:a,taskManagerPageActions:d})=>{const{companyTaskManagerView:l}=a,{uiState:c}=l,{onCockpitReloadData:p,onFetchTaskManagerView:m,onRowClick:x}=d,g=l.fetchState==="Completed",{filters:h}=l.uiState,[j,b]=u.useState(l.uiState.filterText??""),C=()=>{m(c.from,c.sortKey,c.sortOrder,!0,c.filterText)},S=(E,R)=>{m(c.from,E,R,!1,c.filterText,h)},y=u.useRef(o.debounce(E=>m(c.from,c.sortKey,c.sortOrder,!1,E,h),500,{trailing:!0})).current,f=(E,R)=>{b(R);const I=R.trim();I.length>=2?y(I):y("")};return e.filterActions&&(e.filterActions.getCategoryWiseOptions=()=>qu(l)),o.jsxRuntimeExports.jsxs(Qu,{children:[o.jsxRuntimeExports.jsx(dt,{headerActions:{...e,filterActions:{...e.filterActions,onFilterTextChanged:f}},headerData:{...n,allTabOptions:n.allTabOptions??rt,selectedTabOption:"taskManager",companiesLoaded:g,filterData:{filterText:j,filters:h}}}),r?o.jsxRuntimeExports.jsx(tm,{metrics:l.metrics}):null,o.jsxRuntimeExports.jsx(Xu,{companyTaskManagerView:l,fetchNextItemsOnScroll:C,initialOpenThreadRequest:i,onCockpitReloadData:p,onColumnSortConfigChanged:S,onRowClick:x})]})},Xu=({companyTaskManagerView:e,fetchNextItemsOnScroll:n,initialOpenThreadRequest:r,onCockpitReloadData:i,onColumnSortConfigChanged:a,onRowClick:d})=>{const l=t.useWindowSizeContext();return e.fetchState==="Error"&&e.tasksList.length===0?o.jsxRuntimeExports.jsx($t,{selectedCockpitOption:"taskManager",onCockpitReloadData:i}):e.fetchState==="Not-Started"||e.fetchState==="In-Progress"&&e.tasksList.length===0?o.jsxRuntimeExports.jsx(Ju,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})}):e.fetchState==="Completed"&&e.tasksList.length===0?o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:cs.emptySearchTextFirstLine,emptySearchTextSecondLine:cs.emptySearchTextSecondLine,filtersApplied:!1}):o.jsxRuntimeExports.jsx(em,{windowSize:l,children:o.jsxRuntimeExports.jsx(Uu,{companyTaskManagerView:e,fetchNextItemsOnScroll:n,initialOpenThreadRequest:r,onColumnSortConfigChanged:a,onRowClick:d})})},qu=e=>{const n=ji,r=new Map;for(const i of e.tasksList)for(const a of i.tags)r.has(a.tagId)||r.set(a.tagId,a);return n.reduce((i,a)=>{switch(a.value){case"company_id":{const d=(e.companies??[]).map(l=>({label:l.companyInfo.name,value:l.companyInfo.companyId}));return{...i,[a.value]:d}}case"assignees":{const d=(e.users??[]).map(l=>({label:l?.firstName||l?.lastName?`${l?.firstName} ${l?.lastName}`:l?.email??"",value:l.userId,photo:l?.photo,email:l?.email}));return{...i,[a.value]:d}}case"status":return{...i,[a.value]:J.allTaskStatus.map(d=>({label:d.name,value:d.code}))};case"priority":return{...i,[a.value]:J.allTaskPriority.map(d=>({label:d.name,value:d.code}))};case"tag":{const d=Array.from(r.values()).map(l=>({label:l.name,value:l.tagId}));return{...i,[a.value]:d}}default:return{...i,[a.value]:[]}}},{})},Qu=s.div`
|
|
1196
1196
|
height: calc(100vh - 60px);
|
|
1197
1197
|
overflow-y: hidden;
|
|
1198
1198
|
display: flex;
|
|
@@ -1237,7 +1237,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
1237
1237
|
color: ${e=>e.theme.colors.grey2};
|
|
1238
1238
|
`,zo=s(t.H5Regular)`
|
|
1239
1239
|
color: ${e=>e.theme.colors.hero};
|
|
1240
|
-
`,nm={},sm={width:"auto",outline:"none",background:"transparent"},{common:{texts:{anonymousUser:fs},strings:{atTheRate:rm}}}=t.appLocale.getLocalizedStrings(),im=({roomId:e,threadMetadata:n,composerPlaceholder:r,isSubmitComment:i=!1,createThreadCallback:a,composerFormStyle:d={},composerEditorStyle:l={}})=>{const c=Xe.useCreateThread(),p=o.useTheme(),m=u.useCallback(({body:x,attachments:
|
|
1240
|
+
`,nm={},sm={width:"auto",outline:"none",background:"transparent"},{common:{texts:{anonymousUser:fs},strings:{atTheRate:rm}}}=t.appLocale.getLocalizedStrings(),im=({roomId:e,threadMetadata:n,composerPlaceholder:r,isSubmitComment:i=!1,createThreadCallback:a,composerFormStyle:d={},composerEditorStyle:l={}})=>{const c=Xe.useCreateThread(),p=o.useTheme(),m=u.useCallback(({body:x,attachments:g},h)=>{h.preventDefault(),h.stopPropagation();try{c({body:x,attachments:g,metadata:n}),a()}catch(j){console.log(j)}},[c,a,n]);return o.jsxRuntimeExports.jsx(Xe.RoomProvider,{id:e,children:o.jsxRuntimeExports.jsx(mm,{children:o.jsxRuntimeExports.jsxs(St.Composer.Form,{onComposerSubmit:m,style:{...nm,...d},className:"customThreadComposer",children:[o.jsxRuntimeExports.jsx(St.Composer.Editor,{placeholder:r,style:{...t.textStyles.standardRegular,...sm,color:p.colors.primary,...l},components:{Mention:am,MentionSuggestions:lm,Link:pm}}),o.jsxRuntimeExports.jsx(St.Composer.Submit,{asChild:!0,children:o.jsxRuntimeExports.jsx(um,{isSubmitComment:i})})]})})})};function am({userId:e}){const{user:n}=xi.useUser(e);return o.jsxRuntimeExports.jsx(St.Composer.Mention,{asChild:!0,children:o.jsxRuntimeExports.jsxs(gm,{children:[rm,n?.name||fs]})})}function lm({userIds:e,selectedUserId:n}){return e.length===0?null:o.jsxRuntimeExports.jsx(St.Composer.Suggestions,{asChild:!0,children:o.jsxRuntimeExports.jsx(xm,{children:o.jsxRuntimeExports.jsx(St.Composer.SuggestionsList,{asChild:!0,children:o.jsxRuntimeExports.jsx(hm,{children:e.map(r=>o.jsxRuntimeExports.jsx(u.Suspense,{fallback:o.jsxRuntimeExports.jsx(cm,{}),children:o.jsxRuntimeExports.jsx(dm,{userId:r},r)},r))})})})})}function cm(){return o.jsxRuntimeExports.jsxs(Di,{children:[o.jsxRuntimeExports.jsx(Oi,{}),o.jsxRuntimeExports.jsx("span",{children:fs})]})}function dm({userId:e}){const{user:n}=xi.useUser(e);return o.jsxRuntimeExports.jsx(St.Composer.SuggestionsListItem,{asChild:!0,value:n.userId,children:o.jsxRuntimeExports.jsxs(Di,{children:[n.avatar?o.jsxRuntimeExports.jsx(ym,{src:n.avatar,alt:""}):o.jsxRuntimeExports.jsx(Oi,{}),o.jsxRuntimeExports.jsx("span",{children:n.name||n.email||fs})]})},n.userId)}function pm({href:e,children:n}){return o.jsxRuntimeExports.jsx(St.Composer.Link,{href:e,asChild:!0,children:o.jsxRuntimeExports.jsx(Sm,{children:n})})}const um=({isSubmitComment:e=!1})=>{const{isEmpty:n,submit:r}=St.useComposer();return u.useEffect(()=>{e&&!n&&r()},[e,n,r]),o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{})},mm=s.div`
|
|
1241
1241
|
.customThreadComposer span[data-slate-placeholder="true"] {
|
|
1242
1242
|
color: ${e=>e.theme.colors.grey1};
|
|
1243
1243
|
}
|
|
@@ -1318,7 +1318,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
1318
1318
|
left: 19%;
|
|
1319
1319
|
position: absolute;
|
|
1320
1320
|
background-color: ${e=>e.theme.colors.primary};
|
|
1321
|
-
`,{dateFormat:Zs,timeFormat:bm,timeframe:st,common:Rm}=t.appLocale.getLocalizedStrings(),bn=e=>{if(e!=null){const n=J.dateNow();return Math.abs(n.diff(e,"days"))}};function wo(e){if(e==null)return;const n=J.dateNow();if(Math.abs(n.diff(e,"days"))<=0)return`0 ${st.day}`;const[i,a]=e<n?[e,n]:[n,e],d=i.year(),l=i.month(),c=i.date(),p=a.year(),m=a.month(),x=a.date();let S=p-d,h=m-l,C=x-c;if(C<0){h--;const f=new Date(p,m,0);C+=f.getDate()}h<0&&(S--,h+=12);const b=[];return S>0&&b.push(`${S} ${S>1?st.year:st.year.slice(0,-1)}`),h>0&&b.push(`${h} ${h>1?st.month:st.month.slice(0,-1)}`),C>0&&b.push(`${C} ${C>1?st.day:st.day.slice(0,-1)}`),b.join(", ")}function Mi(e){if(e==null)return Rm.strings.hyphen;const n=Math.floor(Number(e)/12),r=Number(e)%12,i=n>1?st.year:st.year.slice(0,-1),a=r>1?st.month:st.month.slice(0,-1);return n===0?`${e} ${a}`:r===0?`${n} ${i}`:`${n} ${i}, ${r} ${a}`}const zi=e=>({name:e?.companyInfo.name??"",productVerticals:e?.companyHealthMetric.verticalProductServices??void 0,runway:e?.companyHealthMetric.runway,churnProbabilityPercentage:e?.companyHealthMetric.churnProbabilityPercentage,netPromoterScore:e?.companyHealthMetric.netPromoterScore,customerSatisfactionScore:e?.companyHealthMetric.customerSatisfactionScore,lastReportSent:e?.managementInfo.lastReportSentDate!=null?wo(J.zeniDate(e?.managementInfo.lastReportSentDate.toISOString())):void 0,dashboardLastVisit:e?.companyHealthMetric.customerLastDashboardVisit!=null?J.zeniDate(e?.companyHealthMetric.customerLastDashboardVisit.toISOString()).format(Zs.visual.MMMDCommaYYYYformat):void 0,companyEngagementMetricsUpdatedAt:e?.companyHealthMetric.companyEngagementMetricsUpdatedAt!=null?{date:J.zeniDate(e?.companyHealthMetric.companyEngagementMetricsUpdatedAt.toISOString()).format(Zs.visual.MMMDCommaYYYYformat),time:J.zeniDate(e?.companyHealthMetric.companyEngagementMetricsUpdatedAt.toISOString()).format(bm.hhmmAFormat)}:void 0,noOfVerticalsEnabled:e?.noOfProductVerticalsEnabled,renewalDate:e?.companyHealthMetric.subscriptionRenewalDate!=null?wo(J.zeniDate(e?.companyHealthMetric.subscriptionRenewalDate.toISOString())):void 0,lastEngagements:e!=null?e.companyHealthMetric.lastEngagements:[],additionalChurnFactors:e!=null?e.companyHealthMetric.additionalChurnFactors:{increasingChurnProbability:[],decreasingChurnProbability:[]},updatedByUserName:e?.companyHealthMetric.updatedByUser!=null?t.getFullName(e.companyHealthMetric.updatedByUser):void 0}),We=t.appLocale.getLocalizedStrings().cockpit.health.header,Nt=[{key:"companyName",value:We.name,sortOrder:"ascending",width:new t.ResponsiveSized(392,392),isThreadAllowed:!0},{key:"churnProbability",value:We.churnProbability,sortOrder:"ascending",width:new t.ResponsiveSized(380,380),isThreadAllowed:!0},{key:"controller",value:We.controller,sortOrder:"ascending",width:new t.ResponsiveSized(200,200),isThreadAllowed:!0},{key:"customerSuccessManager",value:We.customerSuccessManager,sortOrder:"ascending",width:new t.ResponsiveSized(200,200),isThreadAllowed:!0},{key:"lastEngagement",value:We.lastEngagement,sortOrder:"ascending",width:new t.ResponsiveSized(270,270),isThreadAllowed:!0},{key:"companyEngagementMetricsUpdatedAt",value:We.companyEngagementMetricsUpdatedAt,sortOrder:"ascending",width:new t.ResponsiveSized(160,160),isThreadAllowed:!0},{key:"runway",value:We.runway,sortOrder:"ascending",width:new t.ResponsiveSized(220,220),isThreadAllowed:!0},{key:"netPromoterScore",value:We.netPromoterScore,sortOrder:"ascending",width:new t.ResponsiveSized(120,120),isThreadAllowed:!0},{key:"customerSatisfactionScore",value:We.customerSatisfactionScore,sortOrder:"ascending",width:new t.ResponsiveSized(120,120),isThreadAllowed:!0},{key:"lastReportSent",value:We.lastReportSent,sortOrder:"ascending",width:new t.ResponsiveSized(250,250),isThreadAllowed:!0},{key:"dashboardLastSeen",value:We.dashboardLastSeen,sortOrder:"ascending",width:new t.ResponsiveSized(270,270),isThreadAllowed:!0},{key:"subscriptionDate",value:We.subscriptionDate,sortOrder:"ascending",width:new t.ResponsiveSized(200,200),isThreadAllowed:!0},{key:"renewalDate",value:We.renewalDate,sortOrder:"ascending",width:new t.ResponsiveSized(180,180),isThreadAllowed:!0},{key:"group",value:We.group,sortOrder:"ascending",width:new t.ResponsiveSized(148,148),isThreadAllowed:!0},{key:"monthlyRecurringRevenue",value:We.monthlyRecurringRevenue,sortOrder:"ascending",width:new t.ResponsiveSized(196,196),isThreadAllowed:!0},{key:"externalProductServiceExposure",value:We.externalProductServiceExposure,sortOrder:"ascending",width:new t.ResponsiveSized(270,270),isThreadAllowed:!0},{key:"productVerticals",value:We.productVerticals,sortOrder:"ascending",width:new t.ResponsiveSized(360,360),isThreadAllowed:!0}];Nt.map(e=>e.key);const Fi=e=>le.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M10.1094 4H2.3764C2.16286 4 1.98975 4.22386 1.98975 4.5V11.5C1.98975 11.7761 2.16286 12 2.3764 12H10.1094C10.323 12 10.4961 11.7761 10.4961 11.5V4.5C10.4961 4.22386 10.323 4 10.1094 4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M11.0046 7L14.0046 5V11L11.0046 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}));function $m({companyView:e,healthView:n,companyNameSticky:r,totalHeight:i,addThreadRequestThreadId:a,setNoteData:d,setElementRef:l,setAddThreadRequestThreadId:c,onRowClick:p}){const m=t.useWindowSizeContext(),x=t.appLocale.getLocalizedStrings(),{common:{strings:{hyphen:S,backspace:h,space:C,colon:b,dot:f}},cockpit:{health:{detailPage:{churnProbabilityTexts:{churnProbability:g,for:j,is:y,percent:E},notApplicable:R},common:{engagementTypes:I,labels:{lastEngagements:A,factorsThatDecreaseChurnProbability:v,factorsThatIncreaseChurnProbability:T}}}},dateFormat:F}=x,{companyInfo:{companyId:D,name:K},companyHealthMetric:M,controllers:Y,managementInfo:{lastReportSentDate:G,customerSuccessManagerUserIds:w}}=e,P=zi(e),k=n.zeniUsers.values.filter($=>w.includes($.userId)),O=`cockpit_${D}`,z="healthMonitor.notes",{threads:Z,isLoading:ie}=t.useFilteredThreads({entityType:z,companyId:D},!1),N={name:K,companyId:D,companyGroup:e.companyGroup!=null?e.companyGroup.find($=>$.id===e.managementInfo.companyGroupId):void 0,monthlyRecurringRevenue:e.monthlyRecurringRevenue,productVerticals:M.verticalProductServices,runway:M.runway,churnProbabilityPercentage:M.churnProbabilityPercentage,netPromoterScore:M.netPromoterScore,customerSatisfactionScore:M.customerSatisfactionScore,controllers:Y.map($=>J.getUserName($)),customerSuccessManagers:k.map($=>J.getUserName($)),lastReportSent:G!=null?J.zeniDate(G.toISOString()):void 0,subscriptionStartDate:M.subscriptionStartDate!=null?J.zeniDate(M.subscriptionStartDate.toISOString()).format(F.visual.MMMDCommaYYYYformat):void 0,renewalDate:M.subscriptionRenewalDate!=null?J.zeniDate(M.subscriptionRenewalDate.toISOString()):void 0,companyEngagementMetricsUpdatedAt:M.companyEngagementMetricsUpdatedAt,externalProductServiceExposure:M.externalProductServiceExposure},{openThread:H,threads:L,addThread:Q,removeThread:se,setOpenThread:X,setRequestToOpenThread:re}=u.useContext(t.ThreadsContext),te=H!==null?L.get(H):null,he=H?.includes(D)===!0,fe=H!=null&&L.get(H)==null&&he,be=a!=null&&L.get(a)?.metadata.companyId===D,W=u.useCallback(()=>{H?.includes(t.NEW_THREAD_SUFFIX)===!0&&se(H),a!=null&&c(void 0)},[a,H,se,c]),ee=u.useCallback($=>{if($===H)X(null);else if(L.has($))X($);else if($.includes(t.NEW_THREAD_SUFFIX)){const[Ce,ae]=$.replace(t.NEW_THREAD_SUFFIX,"").split("."),ce=Wt(Rt(Ce),J.toHealthSortKeyType(ae),D,K);Q($,{type:"thread",id:$,roomId:O,createdAt:new Date,updatedAt:new Date,comments:[],metadata:ce,resolved:!1}),X($)}},[D,K,H,L,Q,X,O]),ge=u.useCallback(($,Ce,ae=!1)=>{const ce=Nt.find($e=>$e.key===Ce);if(re(null),ce!=null&&($.type==="contextmenu"||ae===!0)){if(ce.isThreadAllowed===!1)return;W(),$.preventDefault(),$.stopPropagation();const $e=t.toCollaborationEntityType({tab:"healthMonitor",key:ce.key}),V=[...t.getFilteredThreads(L,{entityType:$e,companyId:D},"both")],_=V.length>0&&V[0].length>0?V[0][0]:Le("healthMonitor",ce.key,D);L.has(_)?ee(_):a===_?c(void 0):(c(_),X(null))}},[L,D,a,ee,c,X,re,W]),ve=u.useCallback(($,Ce)=>{$.stopPropagation();const ae=Le("healthMonitor",Ce,D);c(void 0),ee(ae)},[D,c,ee]),Re=$=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:$.isElementThreadOpen??!1,isElementThreadPresent:$.isElementThreadPresent??!1,itemKey:$.itemKey,elementThreadId:$.elementThreadId??"",roomId:O,addThreadRequestThreadId:a,openThreadId:H,threadStyle:$.threadStyle,openThreadMetadata:te?.metadata??null,onElementClick:ge,onAddThreadClick:ve});return o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{re(null),a!=null&&(c(void 0),a.includes(t.NEW_THREAD_SUFFIX)&&se(a))},children:o.jsxRuntimeExports.jsx(Em,{windowSize:m,isThreadOpen:he||be,totalHeight:i,isCreationInProgress:fe,"data-testid":t.generateDataTestId("health-monitor-row",D),onClick:()=>p(N.companyId),children:Nt.map(($,Ce)=>{const ae=t.toCollaborationEntityType({tab:"healthMonitor",key:$.key}),ce=Nt.length-2<=Ce,$e=[...t.getFilteredThreads(L,{entityType:ae,companyId:D},"both")],V=$e.length>0&&$e[0].length>0?$e[0][0]:Le("healthMonitor",$.key,D),_=L.get(V),pe=_!=null&&_.resolved===!1,ye=V===H,ke=a===V,ue=P.lastEngagements;switch($.key){case"companyName":return o.jsxRuntimeExports.jsxs(Tm,{companyNameSticky:r,columnWidth:$.width,windowSize:m,isThreadOpen:ye||ke,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-company-name",D),onContextMenu:U=>ge(U,$.key),ref:U=>{l(D,$.key,U)},children:[o.jsxRuntimeExports.jsxs(Im,{"data-testid":t.generateDataTestId("health-monitor-row-company-name-text",D),children:[N.name,o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:ye,roomId:O,openThreadId:H,openThreadMetadata:te?.metadata??null})]}),o.jsxRuntimeExports.jsx(t.Tooltip,{style:{padding:`2px ${t.Space.sp2}`},title:"Notes",children:o.jsxRuntimeExports.jsxs(Dm,{className:"notesIcon","data-testid":t.generateDataTestId("health-monitor-row-notes-icon",D),onClick:U=>{U.preventDefault(),U.stopPropagation(),d({roomId:O,companyId:D,companyName:K,entityType:z})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:Z.length,isLoading:ie}),o.jsxRuntimeExports.jsx(Om,{})]})}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:pe,itemKey:$.key,style:{left:t.Space.sp4},onElementClick:ge}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Le("healthMonitor",$.key,D),addThreadRequestThreadId:a,itemKey:$.key,onAddThreadClick:ve})]},V);case"productVerticals":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-product-verticals",D),onContextMenu:U=>ge(U,$.key),children:[o.jsxRuntimeExports.jsx(Bi,{productVerticals:M.verticalProductServices,testIdSuffix:D}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"runway":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-runway",D),onContextMenu:U=>ge(U,$.key),children:[N.runway!=null?J.isCompanyRunwayInfinite(N.runway)===!0?o.jsxRuntimeExports.jsx(Nm,{"data-testid":t.generateDataTestId("health-monitor-row-runway-infinity",D)}):Mi(N.runway.runwayMonths):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:S}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"churnProbability":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-churn-probability",D),onContextMenu:U=>ge(U,$.key),children:[o.jsxRuntimeExports.jsx(Am,{"data-testid":t.generateDataTestId("health-monitor-row-churn-meter",D),children:o.jsxRuntimeExports.jsx(Ni,{percentage:N.churnProbabilityPercentage,barHeight:12})}),P.churnProbabilityPercentage!=null?o.jsxRuntimeExports.jsx(t.Tooltip,{style:{padding:`12px ${t.Space.sp3}`,textAlign:"left"},title:o.jsxRuntimeExports.jsxs(Fm,{children:[o.jsxRuntimeExports.jsx(Bm,{children:`${g} ${j} ${e.companyInfo.name} ${y} ${Math.round(P.churnProbabilityPercentage??0)}${E}${f}`}),e.companyHealthMetric.churnProbabilityReason.length!==0||e.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(qs,{children:[o.jsxRuntimeExports.jsxs(Qs,{children:[T,b]}),o.jsxRuntimeExports.jsxs(Js,{children:[e.companyHealthMetric.churnProbabilityReason.map((U,Oe)=>o.jsxRuntimeExports.jsx($n,{children:o.jsxRuntimeExports.jsx(En,{children:U.text})},`${o.nanoid()}_${Oe}}`)),e.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.map((U,Oe)=>o.jsxRuntimeExports.jsx($n,{children:o.jsxRuntimeExports.jsx(En,{children:U.value})},`${o.nanoid()}_${Oe}}`))]})]}):null,e.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(qs,{children:[o.jsxRuntimeExports.jsxs(Qs,{children:[v,b]}),o.jsxRuntimeExports.jsx(Js,{children:e.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.map((U,Oe)=>o.jsxRuntimeExports.jsx($n,{children:o.jsxRuntimeExports.jsx(En,{children:U.value})},`${o.nanoid()}_${Oe}}`))})]}):null]}),children:o.jsxRuntimeExports.jsx(zm,{"data-testid":t.generateDataTestId("health-monitor-row-churn-info-icon",D),style:{marginTop:t.Space.sp1,marginLeft:t.Space.sp1,marginRight:t.Space.sp0}})}):null,Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"customerSatisfactionScore":case"netPromoterScore":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId(`health-monitor-row-${$.key==="netPromoterScore"?"nps":"csat"}`,D),onContextMenu:U=>ge(U,$.key),children:[N[$.key]!=null?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Pm,{children:N[$.key]}),o.jsxRuntimeExports.jsx(Lm,{children:h}),$.key==="netPromoterScore"?o.jsxRuntimeExports.jsxs(Xs,{children:[" ",Za," "]}):o.jsxRuntimeExports.jsxs(Xs,{children:[" ",Xa," "]})]}):N.churnProbabilityPercentage!=null?R:S,Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"controller":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-controller",D),onContextMenu:U=>ge(U,$.key),children:[o.jsxRuntimeExports.jsx(t.Tooltip,{enterDelay:600,style:{padding:`2px ${t.Space.sp2}`},title:N.controllers.join(", "),children:N.controllers[0]}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"customerSuccessManager":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-csm",D),onContextMenu:U=>ge(U,$.key),children:[o.jsxRuntimeExports.jsx(t.Tooltip,{enterDelay:600,style:{padding:`2px ${t.Space.sp2}`,textAlign:"left"},maxWidth:"300px",title:N.customerSuccessManagers.join(", "),children:N.customerSuccessManagers[0]}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"lastReportSent":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-last-report-sent",D),onContextMenu:U=>ge(U,$.key),children:[o.jsxRuntimeExports.jsx(Rn,{children:N.lastReportSent!=null?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(t.LargeRegular,{children:wo(N.lastReportSent)}),o.jsxRuntimeExports.jsx(t.SmallRegular,{children:N.lastReportSent.format(F.visual.MMMDCommaYYYYformat)})]}):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:S})}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"renewalDate":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-renewal-date",D),onContextMenu:U=>ge(U,$.key),children:[o.jsxRuntimeExports.jsx(Rn,{children:N.renewalDate!=null?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(t.LargeRegular,{children:wo(N.renewalDate)}),o.jsxRuntimeExports.jsx(t.SmallRegular,{children:N.renewalDate.format(F.visual.MMMDCommaYYYYformat)})]}):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:S})}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"group":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-group",D),onContextMenu:U=>ge(U,$.key),children:[N.companyGroup!=null?o.jsxRuntimeExports.jsx(Mm,{"data-testid":t.generateDataTestId("health-monitor-row-group-badge",D),textColor:$i[N.companyGroup.id],children:N.companyGroup.name.toUpperCase()}):S,Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"monthlyRecurringRevenue":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-mrr",D),onContextMenu:U=>ge(U,$.key),children:[t.amountToString("0,0",N.monthlyRecurringRevenue),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"externalProductServiceExposure":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-external-exposure",D),onContextMenu:U=>ge(U,$.key),children:[N.externalProductServiceExposure!=null?N.externalProductServiceExposure.name:S,Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"lastEngagement":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-last-engagement",D),onContextMenu:U=>ge(U,$.key),children:[ue.length>0?o.jsxRuntimeExports.jsxs(t.Tooltip,{style:{padding:`12px ${t.Space.sp3}`},title:o.jsxRuntimeExports.jsxs(_m,{children:[o.jsxRuntimeExports.jsxs(Wm,{children:[A,b]}),ue.map((U,Oe)=>o.jsxRuntimeExports.jsxs(Vm,{children:[o.jsxRuntimeExports.jsxs(Um,{children:[U.type==="email"?o.jsxRuntimeExports.jsx(Gm,{}):o.jsxRuntimeExports.jsx(Ym,{}),o.jsxRuntimeExports.jsx(vm,{children:U.type==="email"?I.email:I.meeting})]}),o.jsxRuntimeExports.jsx(Hm,{children:U.scheduledAt?.utc(!0).local().format(F.visual.MMMDCommaYYYYformat)??S})]},`${o.nanoid()}_${Oe}}`))]}),children:[ue[0].scheduledAt?.utc(!0).local().format(F.visual.MMMDCommaYYYYformat)??S,o.jsxRuntimeExports.jsxs(Km,{children:[ue[0].type==="email"?o.jsxRuntimeExports.jsx(_i,{className:"engagement-email-icon"}):o.jsxRuntimeExports.jsx(Wi,{className:"engagement-meeting-icon"}),o.jsxRuntimeExports.jsxs(Zm,{children:["Via",C,ue[0].type==="email"?I.email:I.meeting]})]})]}):o.jsxRuntimeExports.jsx(t.StandardRegular,{children:S}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"dashboardLastSeen":case"subscriptionDate":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId(`health-monitor-row-${$.key==="dashboardLastSeen"?"dashboard-last-seen":"subscription-date"}`,D),onContextMenu:U=>ge(U,$.key),children:[N.subscriptionStartDate??S,Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"companyEngagementMetricsUpdatedAt":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-engagement-updated",D),onContextMenu:U=>ge(U,$.key),children:[o.jsxRuntimeExports.jsx(Rn,{children:N.companyEngagementMetricsUpdatedAt!=null?o.jsxRuntimeExports.jsx(t.LargeRegular,{children:wo(N.companyEngagementMetricsUpdatedAt)}):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:S})}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);default:return null}})})})}const Bi=({productVerticals:e,testIdSuffix:n})=>{const r=i=>{switch(i){case"billpay":return{key:"ZBP",color:t.Colors.graphColor34Dark};case"reimbursement":return{key:"ZR",color:t.Colors.graphColor06Dark};case"accounts":return{key:"ZA",color:t.Colors.graphColor09Dark};case"cards":return{key:"ZC",color:t.Colors.graphColor33Dark};case"payroll_manager_service_plan":return{key:"Payroll",color:t.Colors.graphColor26Dark};case"zeni_tax_plan":return{key:"Tax",color:t.Colors.graphColor35Dark};case"cfo_plan":return{key:"CFO",color:t.Colors.graphColor17Dark};default:return}};return o.jsxRuntimeExports.jsx(wm,{"data-testid":t.generateDataTestId("health-monitor-product-services",n),children:e.map((i,a)=>{const d=r(i.productServiceKey);if(d!=null){const l=n!=null&&n!==""?`${d.key}-${n}`:d.key;return o.jsxRuntimeExports.jsx(km,{color:d.color,isEnabled:i.isEnabled,"data-testid":t.generateDataTestId("health-monitor-product-chip",l),children:d.key},`${o.nanoid()}_${a}`)}else return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{})})})},Em=s.div`
|
|
1321
|
+
`,{dateFormat:Zs,timeFormat:bm,timeframe:st,common:Rm}=t.appLocale.getLocalizedStrings(),bn=e=>{if(e!=null){const n=J.dateNow();return Math.abs(n.diff(e,"days"))}};function wo(e){if(e==null)return;const n=J.dateNow();if(Math.abs(n.diff(e,"days"))<=0)return`0 ${st.day}`;const[i,a]=e<n?[e,n]:[n,e],d=i.year(),l=i.month(),c=i.date(),p=a.year(),m=a.month(),x=a.date();let g=p-d,h=m-l,j=x-c;if(j<0){h--;const C=new Date(p,m,0);j+=C.getDate()}h<0&&(g--,h+=12);const b=[];return g>0&&b.push(`${g} ${g>1?st.year:st.year.slice(0,-1)}`),h>0&&b.push(`${h} ${h>1?st.month:st.month.slice(0,-1)}`),j>0&&b.push(`${j} ${j>1?st.day:st.day.slice(0,-1)}`),b.join(", ")}function Mi(e){if(e==null)return Rm.strings.hyphen;const n=Math.floor(Number(e)/12),r=Number(e)%12,i=n>1?st.year:st.year.slice(0,-1),a=r>1?st.month:st.month.slice(0,-1);return n===0?`${e} ${a}`:r===0?`${n} ${i}`:`${n} ${i}, ${r} ${a}`}const zi=e=>({name:e?.companyInfo.name??"",productVerticals:e?.companyHealthMetric.verticalProductServices??void 0,runway:e?.companyHealthMetric.runway,churnProbabilityPercentage:e?.companyHealthMetric.churnProbabilityPercentage,netPromoterScore:e?.companyHealthMetric.netPromoterScore,customerSatisfactionScore:e?.companyHealthMetric.customerSatisfactionScore,lastReportSent:e?.managementInfo.lastReportSentDate!=null?wo(J.zeniDate(e?.managementInfo.lastReportSentDate.toISOString())):void 0,dashboardLastVisit:e?.companyHealthMetric.customerLastDashboardVisit!=null?J.zeniDate(e?.companyHealthMetric.customerLastDashboardVisit.toISOString()).format(Zs.visual.MMMDCommaYYYYformat):void 0,companyEngagementMetricsUpdatedAt:e?.companyHealthMetric.companyEngagementMetricsUpdatedAt!=null?{date:J.zeniDate(e?.companyHealthMetric.companyEngagementMetricsUpdatedAt.toISOString()).format(Zs.visual.MMMDCommaYYYYformat),time:J.zeniDate(e?.companyHealthMetric.companyEngagementMetricsUpdatedAt.toISOString()).format(bm.hhmmAFormat)}:void 0,noOfVerticalsEnabled:e?.noOfProductVerticalsEnabled,renewalDate:e?.companyHealthMetric.subscriptionRenewalDate!=null?wo(J.zeniDate(e?.companyHealthMetric.subscriptionRenewalDate.toISOString())):void 0,lastEngagements:e!=null?e.companyHealthMetric.lastEngagements:[],additionalChurnFactors:e!=null?e.companyHealthMetric.additionalChurnFactors:{increasingChurnProbability:[],decreasingChurnProbability:[]},updatedByUserName:e?.companyHealthMetric.updatedByUser!=null?t.getFullName(e.companyHealthMetric.updatedByUser):void 0}),We=t.appLocale.getLocalizedStrings().cockpit.health.header,Nt=[{key:"companyName",value:We.name,sortOrder:"ascending",width:new t.ResponsiveSized(392,392),isThreadAllowed:!0},{key:"churnProbability",value:We.churnProbability,sortOrder:"ascending",width:new t.ResponsiveSized(380,380),isThreadAllowed:!0},{key:"controller",value:We.controller,sortOrder:"ascending",width:new t.ResponsiveSized(200,200),isThreadAllowed:!0},{key:"customerSuccessManager",value:We.customerSuccessManager,sortOrder:"ascending",width:new t.ResponsiveSized(200,200),isThreadAllowed:!0},{key:"lastEngagement",value:We.lastEngagement,sortOrder:"ascending",width:new t.ResponsiveSized(270,270),isThreadAllowed:!0},{key:"companyEngagementMetricsUpdatedAt",value:We.companyEngagementMetricsUpdatedAt,sortOrder:"ascending",width:new t.ResponsiveSized(160,160),isThreadAllowed:!0},{key:"runway",value:We.runway,sortOrder:"ascending",width:new t.ResponsiveSized(220,220),isThreadAllowed:!0},{key:"netPromoterScore",value:We.netPromoterScore,sortOrder:"ascending",width:new t.ResponsiveSized(120,120),isThreadAllowed:!0},{key:"customerSatisfactionScore",value:We.customerSatisfactionScore,sortOrder:"ascending",width:new t.ResponsiveSized(120,120),isThreadAllowed:!0},{key:"lastReportSent",value:We.lastReportSent,sortOrder:"ascending",width:new t.ResponsiveSized(250,250),isThreadAllowed:!0},{key:"dashboardLastSeen",value:We.dashboardLastSeen,sortOrder:"ascending",width:new t.ResponsiveSized(270,270),isThreadAllowed:!0},{key:"subscriptionDate",value:We.subscriptionDate,sortOrder:"ascending",width:new t.ResponsiveSized(200,200),isThreadAllowed:!0},{key:"renewalDate",value:We.renewalDate,sortOrder:"ascending",width:new t.ResponsiveSized(180,180),isThreadAllowed:!0},{key:"group",value:We.group,sortOrder:"ascending",width:new t.ResponsiveSized(148,148),isThreadAllowed:!0},{key:"monthlyRecurringRevenue",value:We.monthlyRecurringRevenue,sortOrder:"ascending",width:new t.ResponsiveSized(196,196),isThreadAllowed:!0},{key:"externalProductServiceExposure",value:We.externalProductServiceExposure,sortOrder:"ascending",width:new t.ResponsiveSized(270,270),isThreadAllowed:!0},{key:"productVerticals",value:We.productVerticals,sortOrder:"ascending",width:new t.ResponsiveSized(360,360),isThreadAllowed:!0}];Nt.map(e=>e.key);const Fi=e=>le.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M10.1094 4H2.3764C2.16286 4 1.98975 4.22386 1.98975 4.5V11.5C1.98975 11.7761 2.16286 12 2.3764 12H10.1094C10.323 12 10.4961 11.7761 10.4961 11.5V4.5C10.4961 4.22386 10.323 4 10.1094 4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M11.0046 7L14.0046 5V11L11.0046 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}));function $m({companyView:e,healthView:n,companyNameSticky:r,totalHeight:i,addThreadRequestThreadId:a,setNoteData:d,setElementRef:l,setAddThreadRequestThreadId:c,onRowClick:p}){const m=t.useWindowSizeContext(),x=t.appLocale.getLocalizedStrings(),{common:{strings:{hyphen:g,backspace:h,space:j,colon:b,dot:C}},cockpit:{health:{detailPage:{churnProbabilityTexts:{churnProbability:S,for:y,is:f,percent:E},notApplicable:R},common:{engagementTypes:I,labels:{lastEngagements:A,factorsThatDecreaseChurnProbability:v,factorsThatIncreaseChurnProbability:T}}}},dateFormat:F}=x,{companyInfo:{companyId:D,name:K},companyHealthMetric:M,controllers:Y,managementInfo:{lastReportSentDate:G,customerSuccessManagerUserIds:w}}=e,P=zi(e),k=n.zeniUsers.values.filter($=>w.includes($.userId)),O=`cockpit_${D}`,z="healthMonitor.notes",{threads:Z,isLoading:ie}=t.useFilteredThreads({entityType:z,companyId:D},!1),N={name:K,companyId:D,companyGroup:e.companyGroup!=null?e.companyGroup.find($=>$.id===e.managementInfo.companyGroupId):void 0,monthlyRecurringRevenue:e.monthlyRecurringRevenue,productVerticals:M.verticalProductServices,runway:M.runway,churnProbabilityPercentage:M.churnProbabilityPercentage,netPromoterScore:M.netPromoterScore,customerSatisfactionScore:M.customerSatisfactionScore,controllers:Y.map($=>J.getUserName($)),customerSuccessManagers:k.map($=>J.getUserName($)),lastReportSent:G!=null?J.zeniDate(G.toISOString()):void 0,subscriptionStartDate:M.subscriptionStartDate!=null?J.zeniDate(M.subscriptionStartDate.toISOString()).format(F.visual.MMMDCommaYYYYformat):void 0,renewalDate:M.subscriptionRenewalDate!=null?J.zeniDate(M.subscriptionRenewalDate.toISOString()):void 0,companyEngagementMetricsUpdatedAt:M.companyEngagementMetricsUpdatedAt,externalProductServiceExposure:M.externalProductServiceExposure},{openThread:H,threads:L,addThread:Q,removeThread:se,setOpenThread:X,setRequestToOpenThread:re}=u.useContext(t.ThreadsContext),te=H!==null?L.get(H):null,he=H?.includes(D)===!0,fe=H!=null&&L.get(H)==null&&he,be=a!=null&&L.get(a)?.metadata.companyId===D,W=u.useCallback(()=>{H?.includes(t.NEW_THREAD_SUFFIX)===!0&&se(H),a!=null&&c(void 0)},[a,H,se,c]),ee=u.useCallback($=>{if($===H)X(null);else if(L.has($))X($);else if($.includes(t.NEW_THREAD_SUFFIX)){const[Ce,ae]=$.replace(t.NEW_THREAD_SUFFIX,"").split("."),ce=Wt(Rt(Ce),J.toHealthSortKeyType(ae),D,K);Q($,{type:"thread",id:$,roomId:O,createdAt:new Date,updatedAt:new Date,comments:[],metadata:ce,resolved:!1}),X($)}},[D,K,H,L,Q,X,O]),ge=u.useCallback(($,Ce,ae=!1)=>{const ce=Nt.find($e=>$e.key===Ce);if(re(null),ce!=null&&($.type==="contextmenu"||ae===!0)){if(ce.isThreadAllowed===!1)return;W(),$.preventDefault(),$.stopPropagation();const $e=t.toCollaborationEntityType({tab:"healthMonitor",key:ce.key}),V=[...t.getFilteredThreads(L,{entityType:$e,companyId:D},"both")],_=V.length>0&&V[0].length>0?V[0][0]:Le("healthMonitor",ce.key,D);L.has(_)?ee(_):a===_?c(void 0):(c(_),X(null))}},[L,D,a,ee,c,X,re,W]),ve=u.useCallback(($,Ce)=>{$.stopPropagation();const ae=Le("healthMonitor",Ce,D);c(void 0),ee(ae)},[D,c,ee]),Re=$=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:$.isElementThreadOpen??!1,isElementThreadPresent:$.isElementThreadPresent??!1,itemKey:$.itemKey,elementThreadId:$.elementThreadId??"",roomId:O,addThreadRequestThreadId:a,openThreadId:H,threadStyle:$.threadStyle,openThreadMetadata:te?.metadata??null,onElementClick:ge,onAddThreadClick:ve});return o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{re(null),a!=null&&(c(void 0),a.includes(t.NEW_THREAD_SUFFIX)&&se(a))},children:o.jsxRuntimeExports.jsx(Em,{windowSize:m,isThreadOpen:he||be,totalHeight:i,isCreationInProgress:fe,"data-testid":t.generateDataTestId("health-monitor-row",D),onClick:()=>p(N.companyId),children:Nt.map(($,Ce)=>{const ae=t.toCollaborationEntityType({tab:"healthMonitor",key:$.key}),ce=Nt.length-2<=Ce,$e=[...t.getFilteredThreads(L,{entityType:ae,companyId:D},"both")],V=$e.length>0&&$e[0].length>0?$e[0][0]:Le("healthMonitor",$.key,D),_=L.get(V),pe=_!=null&&_.resolved===!1,ye=V===H,ke=a===V,ue=P.lastEngagements;switch($.key){case"companyName":return o.jsxRuntimeExports.jsxs(Tm,{companyNameSticky:r,columnWidth:$.width,windowSize:m,isThreadOpen:ye||ke,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-company-name",D),onContextMenu:U=>ge(U,$.key),ref:U=>{l(D,$.key,U)},children:[o.jsxRuntimeExports.jsxs(Im,{"data-testid":t.generateDataTestId("health-monitor-row-company-name-text",D),children:[N.name,o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:ye,roomId:O,openThreadId:H,openThreadMetadata:te?.metadata??null})]}),o.jsxRuntimeExports.jsx(t.Tooltip,{style:{padding:`2px ${t.Space.sp2}`},title:"Notes",children:o.jsxRuntimeExports.jsxs(Dm,{className:"notesIcon","data-testid":t.generateDataTestId("health-monitor-row-notes-icon",D),onClick:U=>{U.preventDefault(),U.stopPropagation(),d({roomId:O,companyId:D,companyName:K,entityType:z})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:Z.length,isLoading:ie}),o.jsxRuntimeExports.jsx(Om,{})]})}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:pe,itemKey:$.key,style:{left:t.Space.sp4},onElementClick:ge}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Le("healthMonitor",$.key,D),addThreadRequestThreadId:a,itemKey:$.key,onAddThreadClick:ve})]},V);case"productVerticals":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-product-verticals",D),onContextMenu:U=>ge(U,$.key),children:[o.jsxRuntimeExports.jsx(Bi,{productVerticals:M.verticalProductServices,testIdSuffix:D}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"runway":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-runway",D),onContextMenu:U=>ge(U,$.key),children:[N.runway!=null?J.isCompanyRunwayInfinite(N.runway)===!0?o.jsxRuntimeExports.jsx(Nm,{"data-testid":t.generateDataTestId("health-monitor-row-runway-infinity",D)}):Mi(N.runway.runwayMonths):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:g}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"churnProbability":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-churn-probability",D),onContextMenu:U=>ge(U,$.key),children:[o.jsxRuntimeExports.jsx(Am,{"data-testid":t.generateDataTestId("health-monitor-row-churn-meter",D),children:o.jsxRuntimeExports.jsx(Ni,{percentage:N.churnProbabilityPercentage,barHeight:12})}),P.churnProbabilityPercentage!=null?o.jsxRuntimeExports.jsx(t.Tooltip,{style:{padding:`12px ${t.Space.sp3}`,textAlign:"left"},title:o.jsxRuntimeExports.jsxs(Fm,{children:[o.jsxRuntimeExports.jsx(Bm,{children:`${S} ${y} ${e.companyInfo.name} ${f} ${Math.round(P.churnProbabilityPercentage??0)}${E}${C}`}),e.companyHealthMetric.churnProbabilityReason.length!==0||e.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(qs,{children:[o.jsxRuntimeExports.jsxs(Qs,{children:[T,b]}),o.jsxRuntimeExports.jsxs(Js,{children:[e.companyHealthMetric.churnProbabilityReason.map((U,Oe)=>o.jsxRuntimeExports.jsx($n,{children:o.jsxRuntimeExports.jsx(En,{children:U.text})},`${o.nanoid()}_${Oe}}`)),e.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.map((U,Oe)=>o.jsxRuntimeExports.jsx($n,{children:o.jsxRuntimeExports.jsx(En,{children:U.value})},`${o.nanoid()}_${Oe}}`))]})]}):null,e.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(qs,{children:[o.jsxRuntimeExports.jsxs(Qs,{children:[v,b]}),o.jsxRuntimeExports.jsx(Js,{children:e.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.map((U,Oe)=>o.jsxRuntimeExports.jsx($n,{children:o.jsxRuntimeExports.jsx(En,{children:U.value})},`${o.nanoid()}_${Oe}}`))})]}):null]}),children:o.jsxRuntimeExports.jsx(zm,{"data-testid":t.generateDataTestId("health-monitor-row-churn-info-icon",D),style:{marginTop:t.Space.sp1,marginLeft:t.Space.sp1,marginRight:t.Space.sp0}})}):null,Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"customerSatisfactionScore":case"netPromoterScore":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId(`health-monitor-row-${$.key==="netPromoterScore"?"nps":"csat"}`,D),onContextMenu:U=>ge(U,$.key),children:[N[$.key]!=null?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Pm,{children:N[$.key]}),o.jsxRuntimeExports.jsx(Lm,{children:h}),$.key==="netPromoterScore"?o.jsxRuntimeExports.jsxs(Xs,{children:[" ",Za," "]}):o.jsxRuntimeExports.jsxs(Xs,{children:[" ",Xa," "]})]}):N.churnProbabilityPercentage!=null?R:g,Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"controller":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-controller",D),onContextMenu:U=>ge(U,$.key),children:[o.jsxRuntimeExports.jsx(t.Tooltip,{enterDelay:600,style:{padding:`2px ${t.Space.sp2}`},title:N.controllers.join(", "),children:N.controllers[0]}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"customerSuccessManager":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-csm",D),onContextMenu:U=>ge(U,$.key),children:[o.jsxRuntimeExports.jsx(t.Tooltip,{enterDelay:600,style:{padding:`2px ${t.Space.sp2}`,textAlign:"left"},maxWidth:"300px",title:N.customerSuccessManagers.join(", "),children:N.customerSuccessManagers[0]}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"lastReportSent":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-last-report-sent",D),onContextMenu:U=>ge(U,$.key),children:[o.jsxRuntimeExports.jsx(Rn,{children:N.lastReportSent!=null?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(t.LargeRegular,{children:wo(N.lastReportSent)}),o.jsxRuntimeExports.jsx(t.SmallRegular,{children:N.lastReportSent.format(F.visual.MMMDCommaYYYYformat)})]}):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:g})}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"renewalDate":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-renewal-date",D),onContextMenu:U=>ge(U,$.key),children:[o.jsxRuntimeExports.jsx(Rn,{children:N.renewalDate!=null?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(t.LargeRegular,{children:wo(N.renewalDate)}),o.jsxRuntimeExports.jsx(t.SmallRegular,{children:N.renewalDate.format(F.visual.MMMDCommaYYYYformat)})]}):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:g})}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"group":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-group",D),onContextMenu:U=>ge(U,$.key),children:[N.companyGroup!=null?o.jsxRuntimeExports.jsx(Mm,{"data-testid":t.generateDataTestId("health-monitor-row-group-badge",D),textColor:$i[N.companyGroup.id],children:N.companyGroup.name.toUpperCase()}):g,Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"monthlyRecurringRevenue":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-mrr",D),onContextMenu:U=>ge(U,$.key),children:[t.amountToString("0,0",N.monthlyRecurringRevenue),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"externalProductServiceExposure":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-external-exposure",D),onContextMenu:U=>ge(U,$.key),children:[N.externalProductServiceExposure!=null?N.externalProductServiceExposure.name:g,Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"lastEngagement":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-last-engagement",D),onContextMenu:U=>ge(U,$.key),children:[ue.length>0?o.jsxRuntimeExports.jsxs(t.Tooltip,{style:{padding:`12px ${t.Space.sp3}`},title:o.jsxRuntimeExports.jsxs(_m,{children:[o.jsxRuntimeExports.jsxs(Wm,{children:[A,b]}),ue.map((U,Oe)=>o.jsxRuntimeExports.jsxs(Vm,{children:[o.jsxRuntimeExports.jsxs(Um,{children:[U.type==="email"?o.jsxRuntimeExports.jsx(Gm,{}):o.jsxRuntimeExports.jsx(Ym,{}),o.jsxRuntimeExports.jsx(vm,{children:U.type==="email"?I.email:I.meeting})]}),o.jsxRuntimeExports.jsx(Hm,{children:U.scheduledAt?.utc(!0).local().format(F.visual.MMMDCommaYYYYformat)??g})]},`${o.nanoid()}_${Oe}}`))]}),children:[ue[0].scheduledAt?.utc(!0).local().format(F.visual.MMMDCommaYYYYformat)??g,o.jsxRuntimeExports.jsxs(Km,{children:[ue[0].type==="email"?o.jsxRuntimeExports.jsx(_i,{className:"engagement-email-icon"}):o.jsxRuntimeExports.jsx(Wi,{className:"engagement-meeting-icon"}),o.jsxRuntimeExports.jsxs(Zm,{children:["Via",j,ue[0].type==="email"?I.email:I.meeting]})]})]}):o.jsxRuntimeExports.jsx(t.StandardRegular,{children:g}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"dashboardLastSeen":case"subscriptionDate":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId(`health-monitor-row-${$.key==="dashboardLastSeen"?"dashboard-last-seen":"subscription-date"}`,D),onContextMenu:U=>ge(U,$.key),children:[N.subscriptionStartDate??g,Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"companyEngagementMetricsUpdatedAt":return o.jsxRuntimeExports.jsxs(qe,{ref:U=>{l(D,$.key,U)},columnWidth:$.width,windowSize:m,isThreadAllowed:$.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-engagement-updated",D),onContextMenu:U=>ge(U,$.key),children:[o.jsxRuntimeExports.jsx(Rn,{children:N.companyEngagementMetricsUpdatedAt!=null?o.jsxRuntimeExports.jsx(t.LargeRegular,{children:wo(N.companyEngagementMetricsUpdatedAt)}):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:g})}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);default:return null}})})})}const Bi=({productVerticals:e,testIdSuffix:n})=>{const r=i=>{switch(i){case"billpay":return{key:"ZBP",color:t.Colors.graphColor34Dark};case"reimbursement":return{key:"ZR",color:t.Colors.graphColor06Dark};case"accounts":return{key:"ZA",color:t.Colors.graphColor09Dark};case"cards":return{key:"ZC",color:t.Colors.graphColor33Dark};case"payroll_manager_service_plan":return{key:"Payroll",color:t.Colors.graphColor26Dark};case"zeni_tax_plan":return{key:"Tax",color:t.Colors.graphColor35Dark};case"cfo_plan":return{key:"CFO",color:t.Colors.graphColor17Dark};default:return}};return o.jsxRuntimeExports.jsx(wm,{"data-testid":t.generateDataTestId("health-monitor-product-services",n),children:e.map((i,a)=>{const d=r(i.productServiceKey);if(d!=null){const l=n!=null&&n!==""?`${d.key}-${n}`:d.key;return o.jsxRuntimeExports.jsx(km,{color:d.color,isEnabled:i.isEnabled,"data-testid":t.generateDataTestId("health-monitor-product-chip",l),children:d.key},`${o.nanoid()}_${a}`)}else return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{})})})},Em=s.div`
|
|
1322
1322
|
border: 1px solid ${e=>e.theme.colors.grey3};
|
|
1323
1323
|
border-radius: ${t.Space.sp2};
|
|
1324
1324
|
display: flex;
|
|
@@ -1497,7 +1497,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
1497
1497
|
color: ${t.Colors.heroDark};
|
|
1498
1498
|
`,Ym=s(Wi)`
|
|
1499
1499
|
color: ${t.Colors.heroDark};
|
|
1500
|
-
`,Zm=s(t.SmallRegular)``,Bo=(e,n)=>`${e}.${n}`,er=e=>`${e}_form`,ht="healthMonitorDetails",tr="healthMonitorPage",or="netPromoterScore",nr="customerSatisfactionScore",sr="externalProductServiceExposure",rr="additionalChurnFactors",Vi=e=>[{label:ax,options:e.increasingChurnProbability.map(n=>({label:n.value,value:n.code}))},{label:ix,options:e.decreasingChurnProbability.map(n=>({label:n.value,value:n.code}))}],Ui=e=>e==null?[]:e.increasingChurnProbability.map(n=>n.code).concat(e.decreasingChurnProbability.map(n=>n.code)),{common:{to:Xm,from:qm,cc:Qm,host:Jm,attendees:ex,texts:{subject:ir,addMore:tx,select:ox},strings:{colon:Ze,hyphen:ar,comma:nx,space:sx}},cockpit:{health:{detailPage:Ee,common:{engagementTypes:lr,labels:{lastEngagements:rx,factorsThatDecreaseChurnProbability:ix,factorsThatIncreaseChurnProbability:ax,contributingFactors:lx,increaseChurnProbability:cx,decreasingChurnProbability:dx}}}},dateFormat:px}=t.appLocale.getLocalizedStrings();function ux({localData:e,companyHealthMetricViewSelector:n,additionalChurnFactorsOptions:r,analytics:i,urlSource:a,onCloseDrawer:d,onSaveChangesToLocalStore:l,onSaveClick:c}){const{selectedCompanyDetail:p,localFormDataAndStatusByCompanyId:m}=n,[x,S]=u.useState(!1),h=zi(p),[C,b]=u.useState(!1),[f,g]=u.useState(!1),j=o.useForm({mode:"all",defaultValues:mx(e,r),reValidateMode:"onBlur"}),y=u.useRef(null);function E(w){p!=null&&i.trackCockpitHealthMonitorChurnFormClicked(w,{companyId:p.companyInfo.companyId,companyName:p.companyInfo.name,zeniProductAndServicesCount:p.noOfProductVerticalsEnabled,daysToRenewal:bn(p.companyHealthMetric.subscriptionRenewalDate)??null,netPromoterScore:m?.companyHealthMetricLocalData.netPromoterScore??null,customerSatisfactionScore:m?.companyHealthMetricLocalData.customerSatisfactionScore??null,externalServicesExposure:m?.companyHealthMetricLocalData.externalProductServiceExposure??null,runwayMonths:J.isCompanyRunwayInfinite(p.companyHealthMetric.runway)===!0?1e6:p.companyHealthMetric.runway===void 0?null:p.companyHealthMetric.runway.runwayMonths??null,dashBoardLastSeen:bn(p.companyHealthMetric.customerLastDashboardVisit)??null,lastReportSent:bn(p.managementInfo.lastReportSentDate)??null,churnProbability:p.companyHealthMetric.churnProbabilityPercentage??null})}const R=j.handleSubmit(()=>{E("Save"),y?.current&&y.current.scrollTo({top:0,behavior:"instant"}),b(!0),S(!0),c()}),I=async(w,P)=>{if(w!=null){const B={...P},k=B[ht][rr].selectedOptions,O={netPromoterScore:B[ht][or]?.selectedOption,customerSatisfactionScore:B[ht][nr]?.selectedOption,externalProductServiceExposure:B[ht][sr]?.selectedOption,additionalChurnFactors:{increasingChurnProbability:r.increasingChurnProbability.filter(z=>k.indexOf(z.code)!=-1),decreasingChurnProbability:r.decreasingChurnProbability.filter(z=>k.indexOf(z.code)!=-1)}};l(O)}},A=u.useRef(null),v=u.useRef(null),[T,F]=u.useState(null),D=u.useRef(null),K=Ui(e.additionalChurnFactors);u.useEffect(()=>(v.current=setTimeout(()=>{A.current&&(F(A.current),v.current&&clearTimeout(v.current))},10),()=>{v.current!=null&&clearTimeout(v.current)}),[K]),u.useEffect(()=>{const w=j.watch((P,{name:B})=>{B!=null&&P!=null&&o.defer(()=>I(B,P))});return()=>{w.unsubscribe()}}),u.useEffect(()=>{if(p!=null){const P=p.controllers.map(B=>`${B.firstName} ${B.lastName}`);a||i.trackCockpitHealthMonitorRowClicked(p.companyInfo.companyId,p.companyInfo.name,P,p.companyHealthMetric.netPromoterScore,p.companyHealthMetric.customerSatisfactionScore,p.companyHealthMetric.churnProbabilityPercentage)}},[]);function M(w){return w!=null?`${Ee.churnProbabilityTexts.churnProbability} ${Ee.churnProbabilityTexts.is} ${h.churnProbabilityPercentage}${Ee.churnProbabilityTexts.percent}`:`${Ee.churnProbabilityTexts.churnProbability} ${Ee.churnProbabilityTexts.percent}`}function Y(){E("Cancel"),d()}const G={valueContainer:w=>({...w,padding:`2px ${t.Space.sp3}`,overflow:"unset"}),multiValue:w=>({...w,margin:0})};return o.jsxRuntimeExports.jsxs(_x,{ref:y,"data-testid":t.generateDataTestId("health-monitor-drawer"),children:[o.jsxRuntimeExports.jsxs(Nx,{"data-testid":t.generateDataTestId("health-monitor-drawer-header"),children:[o.jsxRuntimeExports.jsx(Mx,{"data-testid":t.generateDataTestId("health-monitor-drawer-title"),children:`${p?.companyInfo.name}${Ee.heading}`}),o.jsxRuntimeExports.jsx(bx,{"data-testid":t.generateDataTestId("health-monitor-drawer-close-button"),onClick:Y,children:o.jsxRuntimeExports.jsx(Rx,{})})]}),o.jsxRuntimeExports.jsxs(Bx,{children:[n.localFormDataAndStatusByCompanyId?.saveStatus?.fetchState==="Error"?o.jsxRuntimeExports.jsx(qx,{"data-testid":t.generateDataTestId("health-monitor-drawer-error"),children:o.jsxRuntimeExports.jsxs(Qx,{children:[o.jsxRuntimeExports.jsx(eh,{}),n.localFormDataAndStatusByCompanyId.saveStatus.error?.message!=null?o.jsxRuntimeExports.jsx(Jx,{"data-testid":t.generateDataTestId("health-monitor-drawer-error-text"),children:n.localFormDataAndStatusByCompanyId.saveStatus.error?.message}):null]})}):null,o.jsxRuntimeExports.jsx(Ex,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-section"),children:m?.saveStatus?.fetchState==="In-Progress"?o.jsxRuntimeExports.jsxs($x,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-loader"),children:[o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0}),o.jsxRuntimeExports.jsx(t.ExtraLargeRegular,{children:Ee.calculatingProbability})]}):o.jsxRuntimeExports.jsxs(zx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-box"),children:[o.jsxRuntimeExports.jsx(Fx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-heading"),children:M(h.churnProbabilityPercentage)}),o.jsxRuntimeExports.jsx(hx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-meter"),children:o.jsxRuntimeExports.jsx(Ni,{barHeight:32,percentage:h.churnProbabilityPercentage})}),o.jsxRuntimeExports.jsx(wx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-reasons"),children:p?.companyHealthMetric.churnProbabilityPercentage!=null&&p?.companyHealthMetric.churnProbabilityReason.length!==0?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(vx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-contributing-heading"),children:lx}),p.companyHealthMetric.churnProbabilityReason.length!==0||p.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(dr,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-increasing-factors"),children:[o.jsxRuntimeExports.jsx(cr,{children:`${cx}${Ze}`}),o.jsxRuntimeExports.jsxs(ur,{children:[p.companyHealthMetric.churnProbabilityReason.map((w,P)=>o.jsxRuntimeExports.jsx(wn,{children:o.jsxRuntimeExports.jsx(vn,{children:w.text})},`${o.nanoid()}_${P}}`)),p.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.map((w,P)=>o.jsxRuntimeExports.jsxs(wn,{children:[o.jsxRuntimeExports.jsx(vn,{children:w.value}),o.jsxRuntimeExports.jsx(pr,{children:"Newly added"})]},`${o.nanoid()}_${P}}`))]})]}):null,p?.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(dr,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-decreasing-factors"),children:[o.jsxRuntimeExports.jsx(cr,{children:`${dx}${Ze}`}),o.jsxRuntimeExports.jsx(ur,{children:p.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.map((w,P)=>o.jsxRuntimeExports.jsxs(wn,{children:[o.jsxRuntimeExports.jsx(vn,{children:w.value}),o.jsxRuntimeExports.jsx(pr,{children:"Newly added"})]},`${o.nanoid()}_${P}}`))})]}):null,o.jsxRuntimeExports.jsxs(Lx,{"data-testid":t.generateDataTestId("health-monitor-drawer-add-more-button"),onClick:()=>{t.scrollContainerToTargetAdjusted(D?.current,y?.current),setTimeout(()=>{g(!0)},500)},ref:D,children:[o.jsxRuntimeExports.jsx(Tx,{}),o.jsxRuntimeExports.jsx(kx,{children:tx})]})]}):null})]})}),o.jsxRuntimeExports.jsxs(Vx,{"data-testid":t.generateDataTestId("health-monitor-drawer-form-container"),children:[o.jsxRuntimeExports.jsxs(Px,{children:[o.jsxRuntimeExports.jsxs(Ax,{children:[o.jsxRuntimeExports.jsx(Dx,{"data-testid":t.generateDataTestId("health-monitor-drawer-manual-input-heading"),children:Ee.manualInput.header}),o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"250px",variant:"small-description",data:Ee.tooltipTexts.manualInputText,placement:"top",children:o.jsxRuntimeExports.jsx(_o,{"data-testid":t.generateDataTestId("health-monitor-drawer-manual-input-info"),style:{marginTop:t.Space.sp1,marginRight:t.Space.sp0}})})]}),h.companyEngagementMetricsUpdatedAt!=null&&n.localFormDataAndStatusByCompanyId?.saveStatus?.fetchState!=="In-Progress"?o.jsxRuntimeExports.jsx(Ix,{"data-testid":t.generateDataTestId("health-monitor-drawer-last-updated"),children:h.updatedByUserName!=null?o.jsxRuntimeExports.jsxs(mr,{children:[`${Ee.lastUpdatedBy}${Ze} ${h.updatedByUserName}`,o.jsxRuntimeExports.jsx(ps,{}),`${h.companyEngagementMetricsUpdatedAt.date}${nx}${sx}${h.companyEngagementMetricsUpdatedAt.time}`]}):o.jsxRuntimeExports.jsxs(mr,{children:[`${Ee.lastUpdatedAt}${Ze} ${h.companyEngagementMetricsUpdatedAt.date}`,o.jsxRuntimeExports.jsx(ps,{}),`${h.companyEngagementMetricsUpdatedAt.time}`]})}):null]}),o.jsxRuntimeExports.jsx(o.FormProvider,{...j,children:o.jsxRuntimeExports.jsx("form",{id:er(tr),onSubmit:R,children:o.jsxRuntimeExports.jsxs(Ux,{"data-testid":t.generateDataTestId("health-monitor-drawer-form-fields"),children:[o.jsxRuntimeExports.jsx(gx,{"data-testid":t.generateDataTestId("health-monitor-drawer-nps-field"),children:o.jsxRuntimeExports.jsx(t.LabeledSingleSelectNumericField,{label:{label:`${Ee.manualInput.labels.netPromoterScore}${Ze}`,width:0,style:{width:"auto"}},singleSelectNumericField:{customStyleConfig:{input:(w,P)=>({input:{textAlign:P.selectProps.menuIsOpen===!1&&e.netPromoterScore==null?"right":"left"}})},placeholder:Ee.manualInput.placeholders.add,name:Bo(ht,or),defaultValue:{allOptions:fi,selectedOption:e.netPromoterScore},registerOptions:{required:!0,validate:(w,P)=>P.healthMonitorDetails.customerSatisfactionScore.selectedOption?!0:w!=null&&!!w.selectedOption}},style:{width:"auto"}})}),o.jsxRuntimeExports.jsx(kn,{}),o.jsxRuntimeExports.jsx(Sx,{"data-testid":t.generateDataTestId("health-monitor-drawer-csat-field"),children:o.jsxRuntimeExports.jsx(t.LabeledSingleSelectNumericField,{label:{label:`${Ee.manualInput.labels.customerSatisfactionScore}${Ze}`,width:0,labelIcon:o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"300px",variant:"small-description",data:Ee.tooltipTexts.customerSatisfactionScoreText,placement:"top",children:o.jsxRuntimeExports.jsx(_o,{"data-testid":t.generateDataTestId("health-monitor-drawer-csat-info")})}),style:{marginRight:t.Space.sp2,width:"auto"}},singleSelectNumericField:{customStyleConfig:{input:(w,P)=>({input:{textAlign:P.selectProps.menuIsOpen===!1&&e.customerSatisfactionScore==null?"right":"left"}})},placeholder:Ee.manualInput.placeholders.add,name:Bo(ht,nr),defaultValue:{allOptions:Ci,selectedOption:e.customerSatisfactionScore},registerOptions:{required:!0,validate:(w,P)=>P.healthMonitorDetails.netPromoterScore.selectedOption?!0:w!=null&&!!w.selectedOption}},style:{width:"auto"}})}),o.jsxRuntimeExports.jsx(kn,{}),o.jsxRuntimeExports.jsx(yx,{"data-testid":t.generateDataTestId("health-monitor-drawer-external-exposure-field"),children:o.jsxRuntimeExports.jsx(t.LabeledSingleSelectPickerField,{label:{label:Ee.manualInput.labels.externalProductServices,labelIcon:o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"265px",variant:"small-description",data:Ee.tooltipTexts.externalProductServicesText,placement:"top",children:o.jsxRuntimeExports.jsx(_o,{"data-testid":t.generateDataTestId("health-monitor-drawer-external-exposure-info")})}),style:{marginRight:t.Space.sp2}},singleSelectPickerField:{placeholder:Ee.manualInput.placeholders.add,name:Bo(ht,sr),defaultValue:{allOptions:J.companyHealthMetricDropDownOptions,selectedOption:e.externalProductServiceExposure},textAlignment:"right",registerOptions:{required:!0,validate:w=>w!=null&&!!w.selectedOption}},style:{width:"auto"}})}),o.jsxRuntimeExports.jsx(kn,{}),o.jsxRuntimeExports.jsxs(Hx,{"data-testid":t.generateDataTestId("health-monitor-drawer-additional-factors"),additionalNotesHidden:K.length===0,isFocused:f,children:[o.jsxRuntimeExports.jsx(t.LabeledGroupedMultiSelectField,{fullWidthSelect:!0,label:{label:`${Ee.manualInput.labels.additionalContributingFactorsLabel}${Ze}`,labelIcon:o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"280px",variant:"small-description",data:Ee.tooltipTexts.additionalContributingFactorsText,placement:"top",children:o.jsxRuntimeExports.jsx(_o,{"data-testid":t.generateDataTestId("health-monitor-drawer-additional-factors-info")})})},groupedMultiSelectField:{name:Bo(ht,rr),treeViewStructure:!0,registerOptions:{required:!1},defaultValue:{allOptions:Vi(r),selectedOptions:K},placeholder:ox,customStyleConfig:G,showSelectedInNewLines:!0},isMenuOpen:f,setIsMenuOpen:g,menuPortalEnabled:!0}),K.length!==0&&o.jsxRuntimeExports.jsxs(Gx,{"data-testid":t.generateDataTestId("health-monitor-drawer-notes-composer"),children:[o.jsxRuntimeExports.jsx(rh,{}),o.jsxRuntimeExports.jsx(Kx,{ref:A,children:T&&Lo.createPortal(o.jsxRuntimeExports.jsx(im,{roomId:`cockpit_${p?.companyInfo.companyId}`,threadMetadata:{application:"cockpit",companyId:p?.companyInfo.companyId!=null?p.companyInfo.companyId:"",entityId:p?.companyInfo.companyId!=null?p.companyInfo.companyId:"",companyName:p?.companyInfo.name!=null?p.companyInfo.name:"",tab:"healthMonitor",isGlobalComment:!1,entityType:"healthMonitor.notes",url:window.location.href},composerPlaceholder:Ee.manualInput.placeholders.addANote,createThreadCallback:()=>{b(!1)},isSubmitComment:C}),T)})]})]})]})})})]}),o.jsxRuntimeExports.jsxs(Wx,{"data-testid":t.generateDataTestId("health-monitor-drawer-prefilled-section"),children:[o.jsxRuntimeExports.jsx(Ox,{"data-testid":t.generateDataTestId("health-monitor-drawer-prefilled-heading"),children:Ee.preFilledInput.header}),o.jsxRuntimeExports.jsxs(Yx,{"data-testid":t.generateDataTestId("health-monitor-drawer-runway"),children:[o.jsxRuntimeExports.jsx(ao,{children:Ee.preFilledInput.labels.runway}),h.runway!=null?J.isCompanyRunwayInfinite(h.runway)===!0?o.jsxRuntimeExports.jsx(Xx,{}):o.jsxRuntimeExports.jsx(Kt,{children:Mi(h.runway.runwayMonths)}):o.jsxRuntimeExports.jsx(Kt,{children:Ee.notApplicable})]}),o.jsxRuntimeExports.jsxs(Wo,{"data-testid":t.generateDataTestId("health-monitor-drawer-dashboard-last-seen"),children:[o.jsxRuntimeExports.jsx(ao,{children:Ee.preFilledInput.labels.dashboardLastSeen}),o.jsxRuntimeExports.jsx(Kt,{children:h.dashboardLastVisit??Ee.notApplicable})]}),o.jsxRuntimeExports.jsxs(Wo,{"data-testid":t.generateDataTestId("health-monitor-drawer-last-report-sent"),children:[o.jsxRuntimeExports.jsx(ao,{children:Ee.preFilledInput.labels.lastReportSent}),o.jsxRuntimeExports.jsx(Kt,{children:h.lastReportSent??Ee.notApplicable})]}),o.jsxRuntimeExports.jsxs(Wo,{"data-testid":t.generateDataTestId("health-monitor-drawer-product-services"),children:[o.jsxRuntimeExports.jsx(ao,{children:Ee.preFilledInput.labels.zeniProductServices}),o.jsxRuntimeExports.jsx(Kt,{children:o.jsxRuntimeExports.jsx(Bi,{productVerticals:p?.companyHealthMetric.verticalProductServices??[],testIdSuffix:p?.companyInfo.companyId})})]}),o.jsxRuntimeExports.jsxs(Wo,{"data-testid":t.generateDataTestId("health-monitor-drawer-days-to-renewal"),children:[o.jsxRuntimeExports.jsx(ao,{children:Ee.preFilledInput.labels.daysToRenewal}),o.jsxRuntimeExports.jsx(Kt,{children:h.renewalDate??Ee.notApplicable})]}),o.jsxRuntimeExports.jsx(Zx,{"data-testid":t.generateDataTestId("health-monitor-drawer-last-engagements"),children:o.jsxRuntimeExports.jsx(t.LabeledReadOnlyTextField,{label:{label:`${rx}${Ze}`},text:o.jsxRuntimeExports.jsx(th,{children:h.lastEngagements.length>0?h.lastEngagements.map((w,P)=>o.jsxRuntimeExports.jsx(oh,{"data-testid":t.generateDataTestId("health-monitor-drawer-engagement",String(P)),children:o.jsxRuntimeExports.jsx(t.Tooltip,{style:{padding:`12px ${t.Space.sp3}`,color:t.Colors.heroDark},title:o.jsxRuntimeExports.jsx(sh,{children:w.type==="email"?o.jsxRuntimeExports.jsxs(xr,{children:[o.jsxRuntimeExports.jsxs(vt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[ir,Ze]}),o.jsxRuntimeExports.jsx(Tt,{children:w.subject})]}),o.jsxRuntimeExports.jsxs(vt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[qm,Ze]}),o.jsxRuntimeExports.jsx(Tt,{children:w.from})]}),o.jsxRuntimeExports.jsxs(vt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[Xm,Ze]}),o.jsxRuntimeExports.jsx(Tt,{children:w.to})]}),w.cc!=""?o.jsxRuntimeExports.jsxs(vt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[Qm,Ze]}),o.jsxRuntimeExports.jsx(Tt,{children:w.cc})]}):null]}):o.jsxRuntimeExports.jsxs(xr,{children:[o.jsxRuntimeExports.jsxs(vt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[ir,Ze]}),o.jsxRuntimeExports.jsx(Tt,{children:w.subject})]}),o.jsxRuntimeExports.jsxs(vt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[Jm,Ze]}),o.jsxRuntimeExports.jsx(Tt,{children:w.hostName})]}),o.jsxRuntimeExports.jsxs(vt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[ex,Ze]}),o.jsxRuntimeExports.jsx(Tt,{children:w.attendees})]})]})}),placement:"left",children:o.jsxRuntimeExports.jsxs(nh,{children:[o.jsxRuntimeExports.jsxs(jx,{children:[w.type==="email"?o.jsxRuntimeExports.jsx(ah,{"data-testid":t.generateDataTestId("health-monitor-drawer-engagement-email-icon",String(P))}):o.jsxRuntimeExports.jsx(ih,{"data-testid":t.generateDataTestId("health-monitor-drawer-engagement-meeting-icon",String(P))}),o.jsxRuntimeExports.jsx(xx,{children:w.type==="email"?lr.email:lr.meeting})]}),o.jsxRuntimeExports.jsx(lh,{className:"engagementDot"}),o.jsxRuntimeExports.jsx(Cx,{children:w.scheduledAt?.utc(!0).local().format(px.visual.MMMDCommaYYYYformat)??ar})]},`${o.nanoid()}_${P}}`)})},P)):ar}),style:{width:"100%"}})})]})]}),J.hasCompanyHealthMetricFormFieldChanged(p?.companyHealthMetric,m?.companyHealthMetricLocalData)===!0||x===!1?o.jsxRuntimeExports.jsx(fx,{"data-testid":t.generateDataTestId("health-monitor-drawer-footer"),children:o.jsxRuntimeExports.jsx(t.Footer,{style:{zIndex:2,paddingTop:t.Space.sp3,paddingBottom:t.Space.sp3},formId:er(tr),primaryBtn:{label:Ee.buttons.save,style:{minWidth:112},isLoading:m?.saveStatus?.fetchState==="In-Progress"},cancelBtn:{label:Ee.buttons.cancel,style:{minWidth:112},onClick:Y}})}):null]})}const mx=(e,n)=>({[ht]:{netPromoterScore:{selectedOption:e.netPromoterScore,allOptions:fi},customerSatisfactionScore:{selectedOption:e.customerSatisfactionScore,allOptions:Ci},externalProductServiceExposure:{selectedOption:e.externalProductServiceExposure,allOptions:J.companyHealthMetricDropDownOptions},additionalChurnFactors:{selectedOptions:Ui(e.additionalChurnFactors),allOptions:Vi(n)}}}),xx=s.div``,hx=s.div``,gx=s.div``,Sx=s.div``,yx=s.div``,fx=s.div``,Cx=s.div`
|
|
1500
|
+
`,Zm=s(t.SmallRegular)``,Bo=(e,n)=>`${e}.${n}`,er=e=>`${e}_form`,ht="healthMonitorDetails",tr="healthMonitorPage",or="netPromoterScore",nr="customerSatisfactionScore",sr="externalProductServiceExposure",rr="additionalChurnFactors",Vi=e=>[{label:ax,options:e.increasingChurnProbability.map(n=>({label:n.value,value:n.code}))},{label:ix,options:e.decreasingChurnProbability.map(n=>({label:n.value,value:n.code}))}],Ui=e=>e==null?[]:e.increasingChurnProbability.map(n=>n.code).concat(e.decreasingChurnProbability.map(n=>n.code)),{common:{to:Xm,from:qm,cc:Qm,host:Jm,attendees:ex,texts:{subject:ir,addMore:tx,select:ox},strings:{colon:Ze,hyphen:ar,comma:nx,space:sx}},cockpit:{health:{detailPage:Ee,common:{engagementTypes:lr,labels:{lastEngagements:rx,factorsThatDecreaseChurnProbability:ix,factorsThatIncreaseChurnProbability:ax,contributingFactors:lx,increaseChurnProbability:cx,decreasingChurnProbability:dx}}}},dateFormat:px}=t.appLocale.getLocalizedStrings();function ux({localData:e,companyHealthMetricViewSelector:n,additionalChurnFactorsOptions:r,analytics:i,urlSource:a,onCloseDrawer:d,onSaveChangesToLocalStore:l,onSaveClick:c}){const{selectedCompanyDetail:p,localFormDataAndStatusByCompanyId:m}=n,[x,g]=u.useState(!1),h=zi(p),[j,b]=u.useState(!1),[C,S]=u.useState(!1),y=o.useForm({mode:"all",defaultValues:mx(e,r),reValidateMode:"onBlur"}),f=u.useRef(null);function E(w){p!=null&&i.trackCockpitHealthMonitorChurnFormClicked(w,{companyId:p.companyInfo.companyId,companyName:p.companyInfo.name,zeniProductAndServicesCount:p.noOfProductVerticalsEnabled,daysToRenewal:bn(p.companyHealthMetric.subscriptionRenewalDate)??null,netPromoterScore:m?.companyHealthMetricLocalData.netPromoterScore??null,customerSatisfactionScore:m?.companyHealthMetricLocalData.customerSatisfactionScore??null,externalServicesExposure:m?.companyHealthMetricLocalData.externalProductServiceExposure??null,runwayMonths:J.isCompanyRunwayInfinite(p.companyHealthMetric.runway)===!0?1e6:p.companyHealthMetric.runway===void 0?null:p.companyHealthMetric.runway.runwayMonths??null,dashBoardLastSeen:bn(p.companyHealthMetric.customerLastDashboardVisit)??null,lastReportSent:bn(p.managementInfo.lastReportSentDate)??null,churnProbability:p.companyHealthMetric.churnProbabilityPercentage??null})}const R=y.handleSubmit(()=>{E("Save"),f?.current&&f.current.scrollTo({top:0,behavior:"instant"}),b(!0),g(!0),c()}),I=async(w,P)=>{if(w!=null){const B={...P},k=B[ht][rr].selectedOptions,O={netPromoterScore:B[ht][or]?.selectedOption,customerSatisfactionScore:B[ht][nr]?.selectedOption,externalProductServiceExposure:B[ht][sr]?.selectedOption,additionalChurnFactors:{increasingChurnProbability:r.increasingChurnProbability.filter(z=>k.indexOf(z.code)!=-1),decreasingChurnProbability:r.decreasingChurnProbability.filter(z=>k.indexOf(z.code)!=-1)}};l(O)}},A=u.useRef(null),v=u.useRef(null),[T,F]=u.useState(null),D=u.useRef(null),K=Ui(e.additionalChurnFactors);u.useEffect(()=>(v.current=setTimeout(()=>{A.current&&(F(A.current),v.current&&clearTimeout(v.current))},10),()=>{v.current!=null&&clearTimeout(v.current)}),[K]),u.useEffect(()=>{const w=y.watch((P,{name:B})=>{B!=null&&P!=null&&o.defer(()=>I(B,P))});return()=>{w.unsubscribe()}}),u.useEffect(()=>{if(p!=null){const P=p.controllers.map(B=>`${B.firstName} ${B.lastName}`);a||i.trackCockpitHealthMonitorRowClicked(p.companyInfo.companyId,p.companyInfo.name,P,p.companyHealthMetric.netPromoterScore,p.companyHealthMetric.customerSatisfactionScore,p.companyHealthMetric.churnProbabilityPercentage)}},[]);function M(w){return w!=null?`${Ee.churnProbabilityTexts.churnProbability} ${Ee.churnProbabilityTexts.is} ${h.churnProbabilityPercentage}${Ee.churnProbabilityTexts.percent}`:`${Ee.churnProbabilityTexts.churnProbability} ${Ee.churnProbabilityTexts.percent}`}function Y(){E("Cancel"),d()}const G={valueContainer:w=>({...w,padding:`2px ${t.Space.sp3}`,overflow:"unset"}),multiValue:w=>({...w,margin:0})};return o.jsxRuntimeExports.jsxs(_x,{ref:f,"data-testid":t.generateDataTestId("health-monitor-drawer"),children:[o.jsxRuntimeExports.jsxs(Nx,{"data-testid":t.generateDataTestId("health-monitor-drawer-header"),children:[o.jsxRuntimeExports.jsx(Mx,{"data-testid":t.generateDataTestId("health-monitor-drawer-title"),children:`${p?.companyInfo.name}${Ee.heading}`}),o.jsxRuntimeExports.jsx(bx,{"data-testid":t.generateDataTestId("health-monitor-drawer-close-button"),onClick:Y,children:o.jsxRuntimeExports.jsx(Rx,{})})]}),o.jsxRuntimeExports.jsxs(Bx,{children:[n.localFormDataAndStatusByCompanyId?.saveStatus?.fetchState==="Error"?o.jsxRuntimeExports.jsx(qx,{"data-testid":t.generateDataTestId("health-monitor-drawer-error"),children:o.jsxRuntimeExports.jsxs(Qx,{children:[o.jsxRuntimeExports.jsx(eh,{}),n.localFormDataAndStatusByCompanyId.saveStatus.error?.message!=null?o.jsxRuntimeExports.jsx(Jx,{"data-testid":t.generateDataTestId("health-monitor-drawer-error-text"),children:n.localFormDataAndStatusByCompanyId.saveStatus.error?.message}):null]})}):null,o.jsxRuntimeExports.jsx(Ex,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-section"),children:m?.saveStatus?.fetchState==="In-Progress"?o.jsxRuntimeExports.jsxs($x,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-loader"),children:[o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0}),o.jsxRuntimeExports.jsx(t.ExtraLargeRegular,{children:Ee.calculatingProbability})]}):o.jsxRuntimeExports.jsxs(zx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-box"),children:[o.jsxRuntimeExports.jsx(Fx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-heading"),children:M(h.churnProbabilityPercentage)}),o.jsxRuntimeExports.jsx(hx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-meter"),children:o.jsxRuntimeExports.jsx(Ni,{barHeight:32,percentage:h.churnProbabilityPercentage})}),o.jsxRuntimeExports.jsx(wx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-reasons"),children:p?.companyHealthMetric.churnProbabilityPercentage!=null&&p?.companyHealthMetric.churnProbabilityReason.length!==0?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(vx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-contributing-heading"),children:lx}),p.companyHealthMetric.churnProbabilityReason.length!==0||p.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(dr,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-increasing-factors"),children:[o.jsxRuntimeExports.jsx(cr,{children:`${cx}${Ze}`}),o.jsxRuntimeExports.jsxs(ur,{children:[p.companyHealthMetric.churnProbabilityReason.map((w,P)=>o.jsxRuntimeExports.jsx(wn,{children:o.jsxRuntimeExports.jsx(vn,{children:w.text})},`${o.nanoid()}_${P}}`)),p.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.map((w,P)=>o.jsxRuntimeExports.jsxs(wn,{children:[o.jsxRuntimeExports.jsx(vn,{children:w.value}),o.jsxRuntimeExports.jsx(pr,{children:"Newly added"})]},`${o.nanoid()}_${P}}`))]})]}):null,p?.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(dr,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-decreasing-factors"),children:[o.jsxRuntimeExports.jsx(cr,{children:`${dx}${Ze}`}),o.jsxRuntimeExports.jsx(ur,{children:p.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.map((w,P)=>o.jsxRuntimeExports.jsxs(wn,{children:[o.jsxRuntimeExports.jsx(vn,{children:w.value}),o.jsxRuntimeExports.jsx(pr,{children:"Newly added"})]},`${o.nanoid()}_${P}}`))})]}):null,o.jsxRuntimeExports.jsxs(Lx,{"data-testid":t.generateDataTestId("health-monitor-drawer-add-more-button"),onClick:()=>{t.scrollContainerToTargetAdjusted(D?.current,f?.current),setTimeout(()=>{S(!0)},500)},ref:D,children:[o.jsxRuntimeExports.jsx(Tx,{}),o.jsxRuntimeExports.jsx(kx,{children:tx})]})]}):null})]})}),o.jsxRuntimeExports.jsxs(Vx,{"data-testid":t.generateDataTestId("health-monitor-drawer-form-container"),children:[o.jsxRuntimeExports.jsxs(Px,{children:[o.jsxRuntimeExports.jsxs(Ax,{children:[o.jsxRuntimeExports.jsx(Dx,{"data-testid":t.generateDataTestId("health-monitor-drawer-manual-input-heading"),children:Ee.manualInput.header}),o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"250px",variant:"small-description",data:Ee.tooltipTexts.manualInputText,placement:"top",children:o.jsxRuntimeExports.jsx(_o,{"data-testid":t.generateDataTestId("health-monitor-drawer-manual-input-info"),style:{marginTop:t.Space.sp1,marginRight:t.Space.sp0}})})]}),h.companyEngagementMetricsUpdatedAt!=null&&n.localFormDataAndStatusByCompanyId?.saveStatus?.fetchState!=="In-Progress"?o.jsxRuntimeExports.jsx(Ix,{"data-testid":t.generateDataTestId("health-monitor-drawer-last-updated"),children:h.updatedByUserName!=null?o.jsxRuntimeExports.jsxs(mr,{children:[`${Ee.lastUpdatedBy}${Ze} ${h.updatedByUserName}`,o.jsxRuntimeExports.jsx(ps,{}),`${h.companyEngagementMetricsUpdatedAt.date}${nx}${sx}${h.companyEngagementMetricsUpdatedAt.time}`]}):o.jsxRuntimeExports.jsxs(mr,{children:[`${Ee.lastUpdatedAt}${Ze} ${h.companyEngagementMetricsUpdatedAt.date}`,o.jsxRuntimeExports.jsx(ps,{}),`${h.companyEngagementMetricsUpdatedAt.time}`]})}):null]}),o.jsxRuntimeExports.jsx(o.FormProvider,{...y,children:o.jsxRuntimeExports.jsx("form",{id:er(tr),onSubmit:R,children:o.jsxRuntimeExports.jsxs(Ux,{"data-testid":t.generateDataTestId("health-monitor-drawer-form-fields"),children:[o.jsxRuntimeExports.jsx(gx,{"data-testid":t.generateDataTestId("health-monitor-drawer-nps-field"),children:o.jsxRuntimeExports.jsx(t.LabeledSingleSelectNumericField,{label:{label:`${Ee.manualInput.labels.netPromoterScore}${Ze}`,width:0,style:{width:"auto"}},singleSelectNumericField:{customStyleConfig:{input:(w,P)=>({input:{textAlign:P.selectProps.menuIsOpen===!1&&e.netPromoterScore==null?"right":"left"}})},placeholder:Ee.manualInput.placeholders.add,name:Bo(ht,or),defaultValue:{allOptions:fi,selectedOption:e.netPromoterScore},registerOptions:{required:!0,validate:(w,P)=>P.healthMonitorDetails.customerSatisfactionScore.selectedOption?!0:w!=null&&!!w.selectedOption}},style:{width:"auto"}})}),o.jsxRuntimeExports.jsx(kn,{}),o.jsxRuntimeExports.jsx(Sx,{"data-testid":t.generateDataTestId("health-monitor-drawer-csat-field"),children:o.jsxRuntimeExports.jsx(t.LabeledSingleSelectNumericField,{label:{label:`${Ee.manualInput.labels.customerSatisfactionScore}${Ze}`,width:0,labelIcon:o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"300px",variant:"small-description",data:Ee.tooltipTexts.customerSatisfactionScoreText,placement:"top",children:o.jsxRuntimeExports.jsx(_o,{"data-testid":t.generateDataTestId("health-monitor-drawer-csat-info")})}),style:{marginRight:t.Space.sp2,width:"auto"}},singleSelectNumericField:{customStyleConfig:{input:(w,P)=>({input:{textAlign:P.selectProps.menuIsOpen===!1&&e.customerSatisfactionScore==null?"right":"left"}})},placeholder:Ee.manualInput.placeholders.add,name:Bo(ht,nr),defaultValue:{allOptions:Ci,selectedOption:e.customerSatisfactionScore},registerOptions:{required:!0,validate:(w,P)=>P.healthMonitorDetails.netPromoterScore.selectedOption?!0:w!=null&&!!w.selectedOption}},style:{width:"auto"}})}),o.jsxRuntimeExports.jsx(kn,{}),o.jsxRuntimeExports.jsx(yx,{"data-testid":t.generateDataTestId("health-monitor-drawer-external-exposure-field"),children:o.jsxRuntimeExports.jsx(t.LabeledSingleSelectPickerField,{label:{label:Ee.manualInput.labels.externalProductServices,labelIcon:o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"265px",variant:"small-description",data:Ee.tooltipTexts.externalProductServicesText,placement:"top",children:o.jsxRuntimeExports.jsx(_o,{"data-testid":t.generateDataTestId("health-monitor-drawer-external-exposure-info")})}),style:{marginRight:t.Space.sp2}},singleSelectPickerField:{placeholder:Ee.manualInput.placeholders.add,name:Bo(ht,sr),defaultValue:{allOptions:J.companyHealthMetricDropDownOptions,selectedOption:e.externalProductServiceExposure},textAlignment:"right",registerOptions:{required:!0,validate:w=>w!=null&&!!w.selectedOption}},style:{width:"auto"}})}),o.jsxRuntimeExports.jsx(kn,{}),o.jsxRuntimeExports.jsxs(Hx,{"data-testid":t.generateDataTestId("health-monitor-drawer-additional-factors"),additionalNotesHidden:K.length===0,isFocused:C,children:[o.jsxRuntimeExports.jsx(t.LabeledGroupedMultiSelectField,{fullWidthSelect:!0,label:{label:`${Ee.manualInput.labels.additionalContributingFactorsLabel}${Ze}`,labelIcon:o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"280px",variant:"small-description",data:Ee.tooltipTexts.additionalContributingFactorsText,placement:"top",children:o.jsxRuntimeExports.jsx(_o,{"data-testid":t.generateDataTestId("health-monitor-drawer-additional-factors-info")})})},groupedMultiSelectField:{name:Bo(ht,rr),treeViewStructure:!0,registerOptions:{required:!1},defaultValue:{allOptions:Vi(r),selectedOptions:K},placeholder:ox,customStyleConfig:G,showSelectedInNewLines:!0},isMenuOpen:C,setIsMenuOpen:S,menuPortalEnabled:!0}),K.length!==0&&o.jsxRuntimeExports.jsxs(Gx,{"data-testid":t.generateDataTestId("health-monitor-drawer-notes-composer"),children:[o.jsxRuntimeExports.jsx(rh,{}),o.jsxRuntimeExports.jsx(Kx,{ref:A,children:T&&Lo.createPortal(o.jsxRuntimeExports.jsx(im,{roomId:`cockpit_${p?.companyInfo.companyId}`,threadMetadata:{application:"cockpit",companyId:p?.companyInfo.companyId!=null?p.companyInfo.companyId:"",entityId:p?.companyInfo.companyId!=null?p.companyInfo.companyId:"",companyName:p?.companyInfo.name!=null?p.companyInfo.name:"",tab:"healthMonitor",isGlobalComment:!1,entityType:"healthMonitor.notes",url:window.location.href},composerPlaceholder:Ee.manualInput.placeholders.addANote,createThreadCallback:()=>{b(!1)},isSubmitComment:j}),T)})]})]})]})})})]}),o.jsxRuntimeExports.jsxs(Wx,{"data-testid":t.generateDataTestId("health-monitor-drawer-prefilled-section"),children:[o.jsxRuntimeExports.jsx(Ox,{"data-testid":t.generateDataTestId("health-monitor-drawer-prefilled-heading"),children:Ee.preFilledInput.header}),o.jsxRuntimeExports.jsxs(Yx,{"data-testid":t.generateDataTestId("health-monitor-drawer-runway"),children:[o.jsxRuntimeExports.jsx(ao,{children:Ee.preFilledInput.labels.runway}),h.runway!=null?J.isCompanyRunwayInfinite(h.runway)===!0?o.jsxRuntimeExports.jsx(Xx,{}):o.jsxRuntimeExports.jsx(Kt,{children:Mi(h.runway.runwayMonths)}):o.jsxRuntimeExports.jsx(Kt,{children:Ee.notApplicable})]}),o.jsxRuntimeExports.jsxs(Wo,{"data-testid":t.generateDataTestId("health-monitor-drawer-dashboard-last-seen"),children:[o.jsxRuntimeExports.jsx(ao,{children:Ee.preFilledInput.labels.dashboardLastSeen}),o.jsxRuntimeExports.jsx(Kt,{children:h.dashboardLastVisit??Ee.notApplicable})]}),o.jsxRuntimeExports.jsxs(Wo,{"data-testid":t.generateDataTestId("health-monitor-drawer-last-report-sent"),children:[o.jsxRuntimeExports.jsx(ao,{children:Ee.preFilledInput.labels.lastReportSent}),o.jsxRuntimeExports.jsx(Kt,{children:h.lastReportSent??Ee.notApplicable})]}),o.jsxRuntimeExports.jsxs(Wo,{"data-testid":t.generateDataTestId("health-monitor-drawer-product-services"),children:[o.jsxRuntimeExports.jsx(ao,{children:Ee.preFilledInput.labels.zeniProductServices}),o.jsxRuntimeExports.jsx(Kt,{children:o.jsxRuntimeExports.jsx(Bi,{productVerticals:p?.companyHealthMetric.verticalProductServices??[],testIdSuffix:p?.companyInfo.companyId})})]}),o.jsxRuntimeExports.jsxs(Wo,{"data-testid":t.generateDataTestId("health-monitor-drawer-days-to-renewal"),children:[o.jsxRuntimeExports.jsx(ao,{children:Ee.preFilledInput.labels.daysToRenewal}),o.jsxRuntimeExports.jsx(Kt,{children:h.renewalDate??Ee.notApplicable})]}),o.jsxRuntimeExports.jsx(Zx,{"data-testid":t.generateDataTestId("health-monitor-drawer-last-engagements"),children:o.jsxRuntimeExports.jsx(t.LabeledReadOnlyTextField,{label:{label:`${rx}${Ze}`},text:o.jsxRuntimeExports.jsx(th,{children:h.lastEngagements.length>0?h.lastEngagements.map((w,P)=>o.jsxRuntimeExports.jsx(oh,{"data-testid":t.generateDataTestId("health-monitor-drawer-engagement",String(P)),children:o.jsxRuntimeExports.jsx(t.Tooltip,{style:{padding:`12px ${t.Space.sp3}`,color:t.Colors.heroDark},title:o.jsxRuntimeExports.jsx(sh,{children:w.type==="email"?o.jsxRuntimeExports.jsxs(xr,{children:[o.jsxRuntimeExports.jsxs(vt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[ir,Ze]}),o.jsxRuntimeExports.jsx(Tt,{children:w.subject})]}),o.jsxRuntimeExports.jsxs(vt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[qm,Ze]}),o.jsxRuntimeExports.jsx(Tt,{children:w.from})]}),o.jsxRuntimeExports.jsxs(vt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[Xm,Ze]}),o.jsxRuntimeExports.jsx(Tt,{children:w.to})]}),w.cc!=""?o.jsxRuntimeExports.jsxs(vt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[Qm,Ze]}),o.jsxRuntimeExports.jsx(Tt,{children:w.cc})]}):null]}):o.jsxRuntimeExports.jsxs(xr,{children:[o.jsxRuntimeExports.jsxs(vt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[ir,Ze]}),o.jsxRuntimeExports.jsx(Tt,{children:w.subject})]}),o.jsxRuntimeExports.jsxs(vt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[Jm,Ze]}),o.jsxRuntimeExports.jsx(Tt,{children:w.hostName})]}),o.jsxRuntimeExports.jsxs(vt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[ex,Ze]}),o.jsxRuntimeExports.jsx(Tt,{children:w.attendees})]})]})}),placement:"left",children:o.jsxRuntimeExports.jsxs(nh,{children:[o.jsxRuntimeExports.jsxs(jx,{children:[w.type==="email"?o.jsxRuntimeExports.jsx(ah,{"data-testid":t.generateDataTestId("health-monitor-drawer-engagement-email-icon",String(P))}):o.jsxRuntimeExports.jsx(ih,{"data-testid":t.generateDataTestId("health-monitor-drawer-engagement-meeting-icon",String(P))}),o.jsxRuntimeExports.jsx(xx,{children:w.type==="email"?lr.email:lr.meeting})]}),o.jsxRuntimeExports.jsx(lh,{className:"engagementDot"}),o.jsxRuntimeExports.jsx(Cx,{children:w.scheduledAt?.utc(!0).local().format(px.visual.MMMDCommaYYYYformat)??ar})]},`${o.nanoid()}_${P}}`)})},P)):ar}),style:{width:"100%"}})})]})]}),J.hasCompanyHealthMetricFormFieldChanged(p?.companyHealthMetric,m?.companyHealthMetricLocalData)===!0||x===!1?o.jsxRuntimeExports.jsx(fx,{"data-testid":t.generateDataTestId("health-monitor-drawer-footer"),children:o.jsxRuntimeExports.jsx(t.Footer,{style:{zIndex:2,paddingTop:t.Space.sp3,paddingBottom:t.Space.sp3},formId:er(tr),primaryBtn:{label:Ee.buttons.save,style:{minWidth:112},isLoading:m?.saveStatus?.fetchState==="In-Progress"},cancelBtn:{label:Ee.buttons.cancel,style:{minWidth:112},onClick:Y}})}):null]})}const mx=(e,n)=>({[ht]:{netPromoterScore:{selectedOption:e.netPromoterScore,allOptions:fi},customerSatisfactionScore:{selectedOption:e.customerSatisfactionScore,allOptions:Ci},externalProductServiceExposure:{selectedOption:e.externalProductServiceExposure,allOptions:J.companyHealthMetricDropDownOptions},additionalChurnFactors:{selectedOptions:Ui(e.additionalChurnFactors),allOptions:Vi(n)}}}),xx=s.div``,hx=s.div``,gx=s.div``,Sx=s.div``,yx=s.div``,fx=s.div``,Cx=s.div`
|
|
1501
1501
|
min-width: 100px;
|
|
1502
1502
|
`,jx=s.div`
|
|
1503
1503
|
min-width: 80px;
|
|
@@ -1903,7 +1903,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
1903
1903
|
&:hover {
|
|
1904
1904
|
color: ${e=>e.theme.colors.primary};
|
|
1905
1905
|
}
|
|
1906
|
-
`,Sh=e=>le.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M7.07568 15.1944H1.45068C1.28492 15.1944 1.12595 15.1285 1.00874 15.0113C0.891532 14.8941 0.825684 14.7351 0.825684 14.5694V1.44437C0.825684 1.27861 0.891532 1.11964 1.00874 1.00243C1.12595 0.885219 1.28492 0.819371 1.45068 0.819371H9.75881C9.9242 0.818742 10.0831 0.883694 10.2007 0.999996L12.5176 3.31687C12.6348 3.43405 12.7006 3.593 12.7007 3.75875V5.81937",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M3.32568 9.19999L5.17193 7.35374C5.26025 7.2656 5.37635 7.21073 5.50051 7.19843C5.62468 7.18612 5.74928 7.21715 5.85318 7.28624L6.72381 7.86687C6.83014 7.93767 6.95812 7.96849 7.08503 7.95384C7.21193 7.93919 7.32953 7.88003 7.41693 7.78687L9.12818 5.96124",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M3.32568 4.56938V10.8194H5.82568",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M13.0242 9.84985H10.4955C9.11614 9.84985 8.65637 11.1335 8.65637 12.1487C8.68901 12.8186 8.93013 13.4616 9.34603 13.9878V12.8384C9.34603 12.3786 9.57591 12.1487 10.4955 12.1487H13.0242V13.528L15.323 10.9993L13.0242 8.47054V9.84985Z",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"})),{cockpit:{health:{healthMonitorFiltersHeaderInfoText:{showing:yh,outOf:fh,customers:Ch}}},common:{headers:{comments:jh},analytics:bh,strings:{space:Rh}},collaboration:{threads:{placeholder:{addANewComment:$h,replyAComment:Eh},tooltip:{resolveComment:wh,unResolveComment:vh}}}}=t.appLocale.getLocalizedStrings();function kh({healthView:e,mixpanelUrl:n,onRowClick:r,onColumnSortConfigChanged:i,initialOpenThreadRequest:a}){const d=t.useWindowSizeContext(),l=u.useRef(null),[c,p]=u.useState(null),{uiState:m}=e,[x,
|
|
1906
|
+
`,Sh=e=>le.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M7.07568 15.1944H1.45068C1.28492 15.1944 1.12595 15.1285 1.00874 15.0113C0.891532 14.8941 0.825684 14.7351 0.825684 14.5694V1.44437C0.825684 1.27861 0.891532 1.11964 1.00874 1.00243C1.12595 0.885219 1.28492 0.819371 1.45068 0.819371H9.75881C9.9242 0.818742 10.0831 0.883694 10.2007 0.999996L12.5176 3.31687C12.6348 3.43405 12.7006 3.593 12.7007 3.75875V5.81937",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M3.32568 9.19999L5.17193 7.35374C5.26025 7.2656 5.37635 7.21073 5.50051 7.19843C5.62468 7.18612 5.74928 7.21715 5.85318 7.28624L6.72381 7.86687C6.83014 7.93767 6.95812 7.96849 7.08503 7.95384C7.21193 7.93919 7.32953 7.88003 7.41693 7.78687L9.12818 5.96124",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M3.32568 4.56938V10.8194H5.82568",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M13.0242 9.84985H10.4955C9.11614 9.84985 8.65637 11.1335 8.65637 12.1487C8.68901 12.8186 8.93013 13.4616 9.34603 13.9878V12.8384C9.34603 12.3786 9.57591 12.1487 10.4955 12.1487H13.0242V13.528L15.323 10.9993L13.0242 8.47054V9.84985Z",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"})),{cockpit:{health:{healthMonitorFiltersHeaderInfoText:{showing:yh,outOf:fh,customers:Ch}}},common:{headers:{comments:jh},analytics:bh,strings:{space:Rh}},collaboration:{threads:{placeholder:{addANewComment:$h,replyAComment:Eh},tooltip:{resolveComment:wh,unResolveComment:vh}}}}=t.appLocale.getLocalizedStrings();function kh({healthView:e,mixpanelUrl:n,onRowClick:r,onColumnSortConfigChanged:i,initialOpenThreadRequest:a}){const d=t.useWindowSizeContext(),l=u.useRef(null),[c,p]=u.useState(null),{uiState:m}=e,[x,g]=u.useState(null),{unfilteredCompanyCount:h}=e,{companies:j}=e,{setOpenThread:b,setRequestToOpenThread:C,requestToOpenThread:S,isLoading:y}=u.useContext(t.ThreadsContext),[f,E]=u.useState(void 0),R=u.useRef([]),I=!(d==="small"||d==="medium-compact"),A=D=>e.companies[D].companyInfo.name.length>_t?Ie+32:Ie,v=u.useMemo(()=>({makeCompanyNameSticky:I,uiState:m,onColumnSortConfigChanged:i}),[I,m,i]),T=u.useCallback((D,K,M)=>{const Y=e.companies.findIndex(w=>w.companyInfo.companyId===D),G=Nt.findIndex(w=>w.key===K);Y!==-1&&G!==-1&&(R.current[Y]==null?R.current[Y]=[M]:R.current[Y][G]=M)},[e.companies]);u.useEffect(()=>{l.current&&l.current.resetAfterIndex(0)},[e]),u.useEffect(()=>{a!=null&&e.fetchState==="Completed"&&y===!1&&C(a)},[a,e.fetchState,y,C]),u.useEffect(()=>{if(S!=null&&c!=null){const{companyId:D,entityType:K}=S,[M,Y]=K.split("."),G=e.companies.findIndex(k=>k.companyInfo.companyId===D),w=Nt.findIndex(k=>k.key===Y);G!==-1&&!(c.visibleStartIndex<=G&&c.visibleStopIndex>=G)&&l.current?.scrollToItem(G,"center"),setTimeout(()=>{const k=R.current[G]?.[0]?.getBoundingClientRect().bottom,O=R.current[G]?.[0]?.getBoundingClientRect().top;k!=null&&O!=null&&(window.innerHeight>=k&&window.innerHeight>=O||O<0)&&R.current[G][w]?.scrollIntoView({block:"center",behavior:"auto"})},0);const B=setInterval(()=>{const k=R.current[G]?.[w]?.getBoundingClientRect().left,O=R.current[G]?.[w]?.getBoundingClientRect().right,z=R.current[G]?.[w]?.offsetWidth;if(k!=null&&z!=null&&O!=null&&(k<window.innerWidth-z||O<window.innerWidth)){clearInterval(B);const Z=S.threadId,ie=S.onThreadShownCallback;Z&&(C(null),b(S.threadId),ie?.())}},500);setTimeout(()=>{clearInterval(B),C(null)},2e3)}},[S,c,b,C]);const F=()=>{window.open(n,"_blank")};return o.jsxRuntimeExports.jsxs(Lh,{companyNameSticky:I,"data-testid":t.generateDataTestId("health-monitor-list-view"),children:[I&&o.jsxRuntimeExports.jsxs(Nh,{"data-testid":t.generateDataTestId("health-monitor-list-summary-bar"),children:[o.jsxRuntimeExports.jsxs(Mh,{"data-testid":t.generateDataTestId("health-monitor-list-summary-text"),children:[yh," ",o.jsxRuntimeExports.jsx(Oh,{children:j.length})," ",fh,Rh,h," ",Ch]}),o.jsxRuntimeExports.jsx(zh,{"data-testid":t.generateDataTestId("health-monitor-list-analytics-button"),children:o.jsxRuntimeExports.jsx(t.Button,{label:bh,variant:"outline",onClick:F,size:"small",prefixIcon:o.jsxRuntimeExports.jsx(Bh,{})})})]}),o.jsxRuntimeExports.jsx(Ah,{companyNameSticky:I,"data-testid":t.generateDataTestId("health-monitor-list-container"),children:o.jsxRuntimeExports.jsxs(Hi.Provider,{value:v,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:D,width:K})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{innerElementType:Ki,height:D,width:K,ref:l,overscanCount:Bt,itemSize:A,onItemsRendered:M=>p(M),itemData:{healthView:e,makeCompanyNameSticky:I,addThreadRequestThreadId:f,setElementRef:T,setAddThreadRequestThreadId:E,onRowClick:r,setNoteData:g},itemCount:e.companies.length,children:Th})}),x!=null?o.jsxRuntimeExports.jsx(Fh,{"data-testid":t.generateDataTestId("health-monitor-notes-drawer"),children:o.jsxRuntimeExports.jsx(Xe.RoomProvider,{id:x.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${x.companyName} ${jh}`,filter:{application:"cockpit",companyId:x.companyId,entityType:x.entityType,isGlobalComment:!1,tab:"healthMonitor"},isLoading:!1,threadMetadata:{companyName:x.companyName,companyId:x.companyId,entityId:x.companyId,entityType:x.entityType,isGlobalComment:!1,application:"cockpit",tab:"healthMonitor",url:window.location.href},textOverrides:{composerPlaceholder:$h,replyComposerPlaceholder:Eh,threadResolve:wh,threadUnResolve:vh},onThreadClick:D=>null,onCloseAllThreadsDrawer:()=>g(null)})})}):null]})})]})}const Hi=u.createContext(void 0),Th=({index:e,style:n,data:r})=>{const{healthView:i,makeCompanyNameSticky:a,onRowClick:d,addThreadRequestThreadId:l,setElementRef:c,setNoteData:p,setAddThreadRequestThreadId:m}=r,x=i.companies[e],{companyId:g}=x.companyInfo;return o.jsxRuntimeExports.jsx(Ph,{style:{...n,width:"fit-content",minWidth:"100%",padding:`${t.Space.sp0} ${t.Space.sp8} ${t.Space.sp3} ${t.Space.sp0}`},children:o.jsxRuntimeExports.jsx($m,{companyView:i.companies[e],healthView:i,totalHeight:typeof n.height=="number"?n.height:Ie,companyNameSticky:a,addThreadRequestThreadId:l,setNoteData:p,setElementRef:c,setAddThreadRequestThreadId:m,onRowClick:d})},g)},Ki=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,onColumnSortConfigChanged:c}=u.useContext(Hi);return o.jsxRuntimeExports.jsxs(Ih,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(dh,{companyNameSticky:d,onColumnSortConfigChanged:c,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder}}),o.jsxRuntimeExports.jsx(Dh,{children:r})]})});Ki.displayName="Health Monitor view inner element type";const Lh=s.div`
|
|
1907
1907
|
width: 100%;
|
|
1908
1908
|
height: 100%;
|
|
1909
1909
|
background-color: ${e=>e.theme.colors.grey4};
|
|
@@ -1941,7 +1941,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
1941
1941
|
margin-left: ${t.Space.sp1};
|
|
1942
1942
|
cursor: pointer;
|
|
1943
1943
|
stroke: ${e=>e.theme.colors.primary};
|
|
1944
|
-
`,{cockpit:{emptySearchTextFirstLine:_h,emptySearchTextSecondLine:Wh}}=t.appLocale.getLocalizedStrings(),Vh=({headerActions:e,headerData:n,healthPageData:r,healthPageActions:i,initialOpenThreadRequest:a})=>{const{healthView:d,managementView:l,mixpanelUrl:c}=r,{onColumnSortConfigChanged:p,onRowClick:m,onCockpitReloadData:x,onFiltersChange:
|
|
1944
|
+
`,{cockpit:{emptySearchTextFirstLine:_h,emptySearchTextSecondLine:Wh}}=t.appLocale.getLocalizedStrings(),Vh=({headerActions:e,headerData:n,healthPageData:r,healthPageActions:i,initialOpenThreadRequest:a})=>{const{healthView:d,managementView:l,mixpanelUrl:c}=r,{onColumnSortConfigChanged:p,onRowClick:m,onCockpitReloadData:x,onFiltersChange:g}=i,{filterText:h,filters:j}=d.uiState,b=l.fetchState==="Completed"&&d.fetchState==="Completed"&&d.zeniUsers.fetchState==="Completed";return e.filterActions&&(e.filterActions.getCategoryWiseOptions=()=>Hh(d)),o.jsxRuntimeExports.jsxs(Kh,{"data-testid":t.generateDataTestId("health-monitor-page"),children:[o.jsxRuntimeExports.jsx(dt,{headerActions:{...e},headerData:{...n,allTabOptions:n.allTabOptions??rt,selectedTabOption:"healthMonitor",filterData:{filterText:h,filters:j},companiesLoaded:b}}),o.jsxRuntimeExports.jsx(Uh,{healthView:d,initialOpenThreadRequest:a,managementView:l,mixpanelUrl:c,onClearFilter:()=>g({}),onColumnSortConfigChanged:p,onCockpitReloadData:x,onRowClick:m})]})},Uh=({healthView:e,initialOpenThreadRequest:n,managementView:r,mixpanelUrl:i,onClearFilter:a,onCockpitReloadData:d,onColumnSortConfigChanged:l,onRowClick:c})=>{const p=t.useWindowSizeContext();return e.fetchState==="Error"||e.zeniUsers.fetchState==="Error"?o.jsxRuntimeExports.jsx(Yh,{"data-testid":t.generateDataTestId("health-monitor-page-error"),children:o.jsxRuntimeExports.jsx($t,{selectedCockpitOption:"healthMonitor",onCockpitReloadData:d})}):r.fetchState==="In-Progress"||r.fetchState==="Not-Started"||e.fetchState==="In-Progress"||e.fetchState==="Not-Started"||e.zeniUsers.fetchState==="In-Progress"||e.zeniUsers.fetchState==="Not-Started"?o.jsxRuntimeExports.jsx(Gh,{"data-testid":t.generateDataTestId("health-monitor-page-loader"),children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})}):e.companies.length===0?o.jsxRuntimeExports.jsx(Zh,{"data-testid":t.generateDataTestId("health-monitor-page-empty-state"),children:o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:_h,emptySearchTextSecondLine:Wh,filtersApplied:!0,onClearFilter:a})}):o.jsxRuntimeExports.jsx(Xh,{windowSize:p,"data-testid":t.generateDataTestId("health-monitor-page-table-wrapper"),children:o.jsxRuntimeExports.jsx(kh,{healthView:e,mixpanelUrl:i,onColumnSortConfigChanged:l,onRowClick:c,initialOpenThreadRequest:n})})},Hh=e=>{const n=e.zeniUsers.values,r=yi,{companies:i}=e;return r.reduce((a,d)=>{switch(d.value){case"companyGroupId":if(i.length>0&&i[0].companyGroup!=null){const l=i[0].companyGroup.map(c=>{const p=c;return{label:p.name,value:p.id}});return{...a,[d.value]:l}}else return{...a,[d.value]:[]};case"verticalProductServices":return{...a,[d.value]:il};case"runway":return{...a,[d.value]:dl};case"churnProbabilityPercentage":return{...a,[d.value]:al};case"netPromoterScore":return{...a,[d.value]:ll};case"customerSatisfactionScore":return{...a,[d.value]:cl};case"monthlyRecurringRevenue":return{...a,[d.value]:hs};case"externalProductServiceExposure":case"controller":case"customerSuccessManager":{const l=n.map(c=>({label:c.firstName||c.lastName?`${c.firstName} ${c.lastName}`:c.email,value:c.userId,photo:c.photo,email:c.email}));return{...a,[d.value]:l}}default:return{...a,[d.value]:[]}}},{})},Kh=s.div`
|
|
1945
1945
|
height: calc(100vh - 45px);
|
|
1946
1946
|
overflow-y: hidden;
|
|
1947
1947
|
background-color: ${e=>e.theme.colors.grey4};
|
|
@@ -2006,7 +2006,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2006
2006
|
&:hover {
|
|
2007
2007
|
color: ${e=>e.theme.colors.primary};
|
|
2008
2008
|
}
|
|
2009
|
-
`,hr=t.appLocale.getLocalizedStrings().cockpit.subscription,gr=({plansAndAddonNames:e,rowIndex:n,isCollapsed:r,showCollapseToggle:i,onCollapseToggled:a,companyId:d,tenantId:l,onPlanOrAddOnClicked:c})=>{if(i===!0){const p=r?[...e]:[...e].splice(0,3),m=p.length-1;return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:p.map((x,
|
|
2009
|
+
`,hr=t.appLocale.getLocalizedStrings().cockpit.subscription,gr=({plansAndAddonNames:e,rowIndex:n,isCollapsed:r,showCollapseToggle:i,onCollapseToggled:a,companyId:d,tenantId:l,onPlanOrAddOnClicked:c})=>{if(i===!0){const p=r?[...e]:[...e].splice(0,3),m=p.length-1;return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:p.map((x,g)=>o.jsxRuntimeExports.jsx(rg,{listItem:x,isCollapsed:r,rowIndex:n,onCollapseToggled:a,isLastItem:m===g,tenantId:l,companyId:d,onPlanOrAddOnClicked:c},`${x.name}_${g}`))})}else return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:e.map((p,m)=>o.jsxRuntimeExports.jsx(Gi,{children:o.jsxRuntimeExports.jsx(us,{listItem:p,tenantId:l,companyId:d,onPlanOrAddOnClicked:c})},`${p.name}_${m}`))})},rg=({listItem:e,rowIndex:n,isCollapsed:r,isLastItem:i,onCollapseToggled:a,companyId:d,tenantId:l,onPlanOrAddOnClicked:c})=>o.jsxRuntimeExports.jsx(Gi,{children:i?o.jsxRuntimeExports.jsxs(lg,{children:[o.jsxRuntimeExports.jsxs("span",{className:r?"expand":"collapse",children:[o.jsxRuntimeExports.jsx(us,{listItem:e,companyId:d,tenantId:l,onPlanOrAddOnClicked:c}),"..."]})," ",o.jsxRuntimeExports.jsx(ag,{onClick:()=>a?.(n),children:r?hr.lessBtnText:hr.moreBtnText})]}):o.jsxRuntimeExports.jsx(us,{listItem:e,tenantId:l,companyId:d,onPlanOrAddOnClicked:c})}),us=({listItem:e,companyId:n,tenantId:r,onPlanOrAddOnClicked:i})=>o.jsxRuntimeExports.jsx(ig,{isCancelled:e.status==="cancelled",onClick:a=>{a.preventDefault(),r!=null&&i?.(n,r)},children:e.name}),ig=s(t.SmallRegular)`
|
|
2010
2010
|
text-decoration: ${e=>e.isCancelled?"line-through":"unset"};
|
|
2011
2011
|
display: inline;
|
|
2012
2012
|
&:hover {
|
|
@@ -2037,7 +2037,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2037
2037
|
display: inline-block;
|
|
2038
2038
|
}
|
|
2039
2039
|
}
|
|
2040
|
-
`,cn={listItemHeightWithoutPadding:t.sp[10],listItemPadding:34,planAndAddonItemHeight:18},Yi=e=>({height:e.subscriptions.reduce((i,a)=>i+(a.addOns?.length??0),0)*cn.planAndAddonItemHeight+cn.listItemPadding,collapsedHeight:Ie}),Zi=e=>({height:e.subscriptions.reduce((i,a)=>i+(a.plan!=null?1:0),0)*cn.planAndAddonItemHeight+cn.listItemPadding,collapsedHeight:Ie}),cg=e=>{const n=Yi(e),r=Zi(e);return n.height>r.height?n:r},Sr=(e,n)=>{switch(n){case"plans":{const r=Zi(e);return r.height>r.collapsedHeight}case"addons":{const r=Yi(e);return r.height>r.collapsedHeight}}},dg=t.appLocale.getLocalizedStrings(),{cockpit:{management:{placeholder:pg}},common:{strings:lo,due:ug}}=dg,mg=({companyView:e,allUsers:n,rowIndex:r,companyNameSticky:i,isCollapsed:a,totalHeight:d,addThreadRequestThreadId:l,targetElementFromNavigation:c,resetTargetElementFromNavigation:p,setNoteData:m,setElementRef:x,setAddThreadRequestThreadId:S,onCollapseToggled:h,onCompanyNameClicked:C,onPassportIconClicked:b,onPlanOrAddOnClicked:f,changeHandlers:g})=>{const[j,y]=u.useState(null),E=t.useWindowSizeContext(),R=e.primarySubscription?.subscription,I=e.primarySubscription?.summary,A=e.primarySubscription?.summary.summary.tenantId,{companyId:v,name:T}=e.company.company.companyInfo,F=hg(I?.schema?.recommendedAction??[]),D=gg(e,n),K=`cockpit_${v}`,M="subscription.notes",{threads:Y,isLoading:G}=t.useFilteredThreads({entityType:M,companyId:v},!1),{openThread:w,threads:P,addThread:B,removeThread:k,setOpenThread:O}=u.useContext(t.ThreadsContext),z=w!==null?P.get(w):null,Z=w?.includes(v)===!0,ie=w!=null&&P.get(w)==null&&Z,N=l!=null&&P.get(l)?.metadata.companyId===v,H={name:e.company.company.companyInfo.name,status:R?.subscription?.subscription?.status??{code:"",name:""},slabUpperLimit:R?.plan?.plan?.slabUpperLimit??{},slabLowerLimit:R?.plan?.plan?.slabLowerLimit??{},avg2MonthExpenses:I?.summary?.avg2MonthExpenses??{},totalDues:I?.summary?.totalDues??{},recommendedActionName:F[I?.summary?.recommendedActionCode??""]??"",recommendedActionCode:I?.summary?.recommendedActionCode??"",monthlyRecurringRevenue:I?.summary?.monthlyRecurringRevenue??{},...xg(e.subscriptions)},L=o.useForm({mode:"all"}),Q="companyData",se=(W,ee)=>`${W}.${ee}`,X=(W,ee)=>{W===`${Q}.controller`&&v!=null&&(ee.users=Sg(ee,W).users,g(v,ee))};u.useEffect(()=>{const W=L.watch((ee,{name:ge})=>{ge!=null&&ee.companyData!=null&&o.defer(()=>X(ge,ee.companyData))});return()=>{W.unsubscribe()}});const re=u.useCallback(()=>{w?.includes(t.NEW_THREAD_SUFFIX)===!0&&k(w),l!=null&&S(void 0)},[l,w,k,S]),te=W=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:W.isElementThreadOpen??!1,isElementThreadPresent:W.isElementThreadPresent??!1,itemKey:W.itemKey,elementThreadId:W.elementThreadId??"",roomId:K,addThreadRequestThreadId:l,openThreadId:w,threadStyle:W.threadStyle,openThreadMetadata:z?.metadata??null,onElementClick:fe,onAddThreadClick:be,targetElement:c??j}),he=u.useCallback(W=>{if(W===w)O(null);else if(P.has(W))O(W);else if(W.includes(t.NEW_THREAD_SUFFIX)){const[ee,ge]=W.replace(t.NEW_THREAD_SUFFIX,"").split("."),ve=Wt(Rt(ee),J.toSubscriptionSortKeyType(ge),v,T);B(W,{type:"thread",id:W,roomId:K,createdAt:new Date,updatedAt:new Date,comments:[],metadata:ve,resolved:!1}),O(W)}},[v,T,w,P,B,O,K]),fe=u.useCallback((W,ee,ge=!1)=>{const ve=jt.find(Re=>Re.key===ee);if(p(),ve!=null&&(W.type==="contextmenu"||ge===!0)){if(ve.isThreadAllowed===!1)return;re(),W.preventDefault(),W.stopPropagation();const Re=t.toCollaborationEntityType({tab:"subscription",key:ve.key});if(W.target instanceof HTMLElement||W.target instanceof SVGElement)if(ge===!0&&W.target instanceof HTMLElement)y(W.target.parentElement);else if(W.target instanceof HTMLElement){const ae=Ss(W.target,oe);y(ae||W.target)}else{const ae=W.target.closest(`.${oe}`);ae instanceof HTMLElement&&y(ae)}const $=[...t.getFilteredThreads(P,{entityType:Re,companyId:v},"both")],Ce=$.length>0&&$[0].length>0?$[0][0]:Le("subscription",ve.key,v);P.has(Ce)?he(Ce):l===Ce?S(void 0):(S(Ce),O(null))}},[P,v,l,he,S,O,p,re]),be=u.useCallback((W,ee)=>{W.stopPropagation();const ge=Le("subscription",ee,v);S(void 0),he(ge)},[v,S,he]);return o.jsxRuntimeExports.jsx(o.FormProvider,{...L,children:o.jsxRuntimeExports.jsx("form",{style:{height:"100%"},children:o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{p(),l!=null&&(S(void 0),l.includes(t.NEW_THREAD_SUFFIX)&&k(l))},children:o.jsxRuntimeExports.jsx(jg,{windowSize:E,isThreadOpen:Z||N,totalHeight:d,isCreationInProgress:ie,children:jt.map((W,ee)=>{const ge=t.toCollaborationEntityType({tab:"subscription",key:W.key}),ve=jt.length-2<=ee,Re=[...t.getFilteredThreads(P,{entityType:ge,companyId:v},"both")],$=Re.length>0&&Re[0].length>0?Re[0][0]:Le("subscription",W.key,v),Ce=P.get($),ae=Ce!=null&&Ce.resolved===!1,ce=$===w,$e=l===$;switch(W.key){case"companyName":return o.jsxRuntimeExports.jsxs(bg,{companyNameSticky:i,columnWidth:W.width,windowSize:E,isThreadOpen:ce||$e,isThreadAllowed:W.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,W.key),ref:V=>{x(v,W.key,V)},children:[o.jsxRuntimeExports.jsxs(fg,{children:[o.jsxRuntimeExports.jsx(Cg,{onClick:V=>{V.preventDefault(),C(e)},children:H.name}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:ce,targetElement:c??j,roomId:K,openThreadId:w,openThreadMetadata:z?.metadata??null})]}),o.jsxRuntimeExports.jsxs(Rg,{children:[o.jsxRuntimeExports.jsxs(wg,{onClick:V=>{V.preventDefault(),m({roomId:K,companyId:v,companyName:T,entityType:M})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:Y.length,isLoading:G}),o.jsxRuntimeExports.jsx(kg,{})]}),o.jsxRuntimeExports.jsx($g,{onClick:V=>{V.preventDefault(),b(e)},children:o.jsxRuntimeExports.jsx(Eg,{className:"passportIcon"})})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:ae,itemKey:W.key,style:{left:t.Space.sp4},onElementClick:fe}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Le("subscription",W.key,v),addThreadRequestThreadId:l,itemKey:W.key,onAddThreadClick:be})]},$);case"status":return o.jsxRuntimeExports.jsxs(ut,{ref:V=>{x(v,W.key,V)},columnWidth:W.width,windowSize:E,isThreadOpen:Z||$e,isThreadAllowed:W.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,W.key),children:[H.status.code?o.jsxRuntimeExports.jsx(jr,{textColor:t.getCockpitColor(H.status.code),children:H.status.name.toUpperCase()}):lo.hyphen,te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:W.key,elementThreadId:$,threadStyle:ve?{right:t.Space.sp0}:void 0})]},$);case"controller":return o.jsxRuntimeExports.jsxs(ut,{ref:V=>{x(v,W.key,V)},columnWidth:W.width,windowSize:E,isThreadOpen:Z||$e,isThreadAllowed:W.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,W.key),children:[o.jsxRuntimeExports.jsx(t.UserMultiSelectField,{name:se(Q,"controller"),value:D.controller,placeholderLabel:pg.controller,pickerStyles:{titleTextStyle:t.textStyles.largeRegular,multiValueLabelTitleStyle:t.textStyles.largeRegular}}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:W.key,elementThreadId:$,threadStyle:ve?{right:t.Space.sp0}:void 0})]},$);case"plans":return o.jsxRuntimeExports.jsxs(ut,{ref:V=>{x(v,W.key,V)},columnWidth:W.width,windowSize:E,isThreadOpen:Z||$e,isThreadAllowed:W.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,W.key),children:[o.jsxRuntimeExports.jsx(Cr,{children:H.plansWithStatus.length>0?o.jsxRuntimeExports.jsx(gr,{plansAndAddonNames:H.plansWithStatus,isCollapsed:a,rowIndex:r,onCollapseToggled:h,showCollapseToggle:Sr(e,"plans"),companyId:v,tenantId:A,onPlanOrAddOnClicked:f}):lo.hyphen}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:W.key,elementThreadId:$,threadStyle:ve?{right:t.Space.sp0}:void 0})]},$);case"planLowerLimit":return o.jsxRuntimeExports.jsxs(ut,{ref:V=>{x(v,W.key,V)},columnWidth:W.width,windowSize:E,isThreadOpen:Z||$e,isThreadAllowed:W.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,W.key),children:[o.jsxRuntimeExports.jsx(Tn,{widthWrapper:W.width,windowSize:E,textColor:t.getCockpitColor("lowerLimit"),children:t.amountToString("0,0",H.slabLowerLimit)}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:W.key,elementThreadId:$,threadStyle:ve?{right:t.Space.sp0}:void 0})]},$);case"planHigherLimit":return o.jsxRuntimeExports.jsxs(ut,{ref:V=>{x(v,W.key,V)},columnWidth:W.width,windowSize:E,isThreadOpen:Z||$e,isThreadAllowed:W.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,W.key),children:[o.jsxRuntimeExports.jsx(Tn,{widthWrapper:W.width,windowSize:E,textColor:t.getCockpitColor("upperLimit"),children:t.amountToString("0,0",H.slabUpperLimit)}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:W.key,elementThreadId:$,threadStyle:ve?{right:t.Space.sp0}:void 0})]},$);case"avg2MonthExpenses":return o.jsxRuntimeExports.jsxs(ut,{ref:V=>{x(v,W.key,V)},columnWidth:W.width,windowSize:E,isThreadOpen:Z||$e,isThreadAllowed:W.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,W.key),children:[o.jsxRuntimeExports.jsx(Tn,{widthWrapper:W.width,windowSize:E,textColor:t.getCockpitColor("avg2MonthExpenses"),children:t.amountToString("0,0",H.avg2MonthExpenses)}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:W.key,elementThreadId:$,threadStyle:ve?{right:t.Space.sp0}:void 0})]},$);case"addons":return o.jsxRuntimeExports.jsxs(ut,{ref:V=>{x(v,W.key,V)},columnWidth:W.width,windowSize:E,isThreadOpen:Z||$e,isThreadAllowed:W.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,W.key),children:[o.jsxRuntimeExports.jsx(Cr,{children:H.addonsWithStatus.length>0?o.jsxRuntimeExports.jsx(gr,{plansAndAddonNames:H.addonsWithStatus,isCollapsed:a,rowIndex:r,onCollapseToggled:h,showCollapseToggle:Sr(e,"addons"),companyId:v,tenantId:A,onPlanOrAddOnClicked:f}):lo.hyphen}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:W.key,elementThreadId:$,threadStyle:ve?{right:t.Space.sp0}:void 0})]},$);case"upgradeStatus":return o.jsxRuntimeExports.jsxs(ut,{ref:V=>{x(v,W.key,V)},columnWidth:W.width,windowSize:E,isThreadOpen:Z||$e,isThreadAllowed:W.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,W.key),children:[o.jsxRuntimeExports.jsx(fr,{children:H.recommendedActionName?o.jsxRuntimeExports.jsx(jr,{textColor:t.getCockpitColor(H.recommendedActionCode),onClick:V=>{V.preventDefault(),A!=null&&H.recommendedActionCode==="upgrade"&&f(v,A)},code:H.recommendedActionCode,children:H.recommendedActionName}):lo.hyphen}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:W.key,elementThreadId:$,threadStyle:ve?{right:t.Space.sp0}:void 0})]},$);case"monthlyRecurringRevenue":return o.jsxRuntimeExports.jsxs(ut,{ref:V=>{x(v,W.key,V)},columnWidth:W.width,windowSize:E,isThreadOpen:Z||$e,isThreadAllowed:W.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,W.key),children:[o.jsxRuntimeExports.jsxs(fr,{children:[o.jsxRuntimeExports.jsx(t.LargeRegular,{children:t.amountToString("0,0",H.monthlyRecurringRevenue)}),H.totalDues.amount>0?o.jsxRuntimeExports.jsx(vg,{children:t.amountToString("0,0",H.totalDues).concat(lo.space).concat(ug)}):null]}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:W.key,elementThreadId:$,threadStyle:ve?{right:t.Space.sp0}:void 0})]},$);default:return null}})})})})})},xg=e=>{const n={plansWithStatus:[],addonsWithStatus:[]};return e.forEach(r=>{const i=r.plan?.plan.name??"",a=r.subscription.subscription.status.code;i!=null&&n.plansWithStatus.push({name:i,status:a}),r.addOns.forEach(d=>{n.addonsWithStatus.push({name:d.addOn.name,status:a})})}),n},hg=e=>{const n={};return e.reduce((i,a)=>(i[a.code]=a.name,i),n)};function gg(e,n){return{controller:{allUsers:n,selectedUsers:e.controllers.map(r=>r.user)}}}function Sg(e,n){const r={};r.users=[];const i=n.split(".")[1],{selectedUsers:a,deSelectedUsers:d}=e[i];return d==null||d?.length==0?a.forEach(l=>{if(l.isUserSelectionUpdated===!0){const c=yr(i,l.userId,l.isRoleSelected);c!==void 0&&r.users?.push(c)}}):d.forEach(l=>{const c=yr(i,l.userId,l.isRoleSelected);c!==void 0&&r.users?.push(c)}),{users:r.users}}function yg(e){return e==="controller"}function yr(e,n,r){if(yg(e))return{isZeni:!0,role:e,userId:n,isSelected:r}}const fg=s.div``,Cg=s(t.LargeMediumSp)`
|
|
2040
|
+
`,cn={listItemHeightWithoutPadding:t.sp[10],listItemPadding:34,planAndAddonItemHeight:18},Yi=e=>({height:e.subscriptions.reduce((i,a)=>i+(a.addOns?.length??0),0)*cn.planAndAddonItemHeight+cn.listItemPadding,collapsedHeight:Ie}),Zi=e=>({height:e.subscriptions.reduce((i,a)=>i+(a.plan!=null?1:0),0)*cn.planAndAddonItemHeight+cn.listItemPadding,collapsedHeight:Ie}),cg=e=>{const n=Yi(e),r=Zi(e);return n.height>r.height?n:r},Sr=(e,n)=>{switch(n){case"plans":{const r=Zi(e);return r.height>r.collapsedHeight}case"addons":{const r=Yi(e);return r.height>r.collapsedHeight}}},dg=t.appLocale.getLocalizedStrings(),{cockpit:{management:{placeholder:pg}},common:{strings:lo,due:ug}}=dg,mg=({companyView:e,allUsers:n,rowIndex:r,companyNameSticky:i,isCollapsed:a,totalHeight:d,addThreadRequestThreadId:l,targetElementFromNavigation:c,resetTargetElementFromNavigation:p,setNoteData:m,setElementRef:x,setAddThreadRequestThreadId:g,onCollapseToggled:h,onCompanyNameClicked:j,onPassportIconClicked:b,onPlanOrAddOnClicked:C,changeHandlers:S})=>{const[y,f]=u.useState(null),E=t.useWindowSizeContext(),R=e.primarySubscription?.subscription,I=e.primarySubscription?.summary,A=e.primarySubscription?.summary.summary.tenantId,{companyId:v,name:T}=e.company.company.companyInfo,F=hg(I?.schema?.recommendedAction??[]),D=gg(e,n),K=`cockpit_${v}`,M="subscription.notes",{threads:Y,isLoading:G}=t.useFilteredThreads({entityType:M,companyId:v},!1),{openThread:w,threads:P,addThread:B,removeThread:k,setOpenThread:O}=u.useContext(t.ThreadsContext),z=w!==null?P.get(w):null,Z=w?.includes(v)===!0,ie=w!=null&&P.get(w)==null&&Z,N=l!=null&&P.get(l)?.metadata.companyId===v,H={name:e.company.company.companyInfo.name,status:R?.subscription?.subscription?.status??{code:"",name:""},slabUpperLimit:R?.plan?.plan?.slabUpperLimit??{},slabLowerLimit:R?.plan?.plan?.slabLowerLimit??{},avg2MonthExpenses:I?.summary?.avg2MonthExpenses??{},totalDues:I?.summary?.totalDues??{},recommendedActionName:F[I?.summary?.recommendedActionCode??""]??"",recommendedActionCode:I?.summary?.recommendedActionCode??"",monthlyRecurringRevenue:I?.summary?.monthlyRecurringRevenue??{},...xg(e.subscriptions)},L=o.useForm({mode:"all"}),Q="companyData",se=(W,ee)=>`${W}.${ee}`,X=(W,ee)=>{W===`${Q}.controller`&&v!=null&&(ee.users=Sg(ee,W).users,S(v,ee))};u.useEffect(()=>{const W=L.watch((ee,{name:ge})=>{ge!=null&&ee.companyData!=null&&o.defer(()=>X(ge,ee.companyData))});return()=>{W.unsubscribe()}});const re=u.useCallback(()=>{w?.includes(t.NEW_THREAD_SUFFIX)===!0&&k(w),l!=null&&g(void 0)},[l,w,k,g]),te=W=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:W.isElementThreadOpen??!1,isElementThreadPresent:W.isElementThreadPresent??!1,itemKey:W.itemKey,elementThreadId:W.elementThreadId??"",roomId:K,addThreadRequestThreadId:l,openThreadId:w,threadStyle:W.threadStyle,openThreadMetadata:z?.metadata??null,onElementClick:fe,onAddThreadClick:be,targetElement:c??y}),he=u.useCallback(W=>{if(W===w)O(null);else if(P.has(W))O(W);else if(W.includes(t.NEW_THREAD_SUFFIX)){const[ee,ge]=W.replace(t.NEW_THREAD_SUFFIX,"").split("."),ve=Wt(Rt(ee),J.toSubscriptionSortKeyType(ge),v,T);B(W,{type:"thread",id:W,roomId:K,createdAt:new Date,updatedAt:new Date,comments:[],metadata:ve,resolved:!1}),O(W)}},[v,T,w,P,B,O,K]),fe=u.useCallback((W,ee,ge=!1)=>{const ve=jt.find(Re=>Re.key===ee);if(p(),ve!=null&&(W.type==="contextmenu"||ge===!0)){if(ve.isThreadAllowed===!1)return;re(),W.preventDefault(),W.stopPropagation();const Re=t.toCollaborationEntityType({tab:"subscription",key:ve.key});if(W.target instanceof HTMLElement||W.target instanceof SVGElement)if(ge===!0&&W.target instanceof HTMLElement)f(W.target.parentElement);else if(W.target instanceof HTMLElement){const ae=Ss(W.target,oe);f(ae||W.target)}else{const ae=W.target.closest(`.${oe}`);ae instanceof HTMLElement&&f(ae)}const $=[...t.getFilteredThreads(P,{entityType:Re,companyId:v},"both")],Ce=$.length>0&&$[0].length>0?$[0][0]:Le("subscription",ve.key,v);P.has(Ce)?he(Ce):l===Ce?g(void 0):(g(Ce),O(null))}},[P,v,l,he,g,O,p,re]),be=u.useCallback((W,ee)=>{W.stopPropagation();const ge=Le("subscription",ee,v);g(void 0),he(ge)},[v,g,he]);return o.jsxRuntimeExports.jsx(o.FormProvider,{...L,children:o.jsxRuntimeExports.jsx("form",{style:{height:"100%"},children:o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{p(),l!=null&&(g(void 0),l.includes(t.NEW_THREAD_SUFFIX)&&k(l))},children:o.jsxRuntimeExports.jsx(jg,{windowSize:E,isThreadOpen:Z||N,totalHeight:d,isCreationInProgress:ie,children:jt.map((W,ee)=>{const ge=t.toCollaborationEntityType({tab:"subscription",key:W.key}),ve=jt.length-2<=ee,Re=[...t.getFilteredThreads(P,{entityType:ge,companyId:v},"both")],$=Re.length>0&&Re[0].length>0?Re[0][0]:Le("subscription",W.key,v),Ce=P.get($),ae=Ce!=null&&Ce.resolved===!1,ce=$===w,$e=l===$;switch(W.key){case"companyName":return o.jsxRuntimeExports.jsxs(bg,{companyNameSticky:i,columnWidth:W.width,windowSize:E,isThreadOpen:ce||$e,isThreadAllowed:W.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,W.key),ref:V=>{x(v,W.key,V)},children:[o.jsxRuntimeExports.jsxs(fg,{children:[o.jsxRuntimeExports.jsx(Cg,{onClick:V=>{V.preventDefault(),j(e)},children:H.name}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:ce,targetElement:c??y,roomId:K,openThreadId:w,openThreadMetadata:z?.metadata??null})]}),o.jsxRuntimeExports.jsxs(Rg,{children:[o.jsxRuntimeExports.jsxs(wg,{onClick:V=>{V.preventDefault(),m({roomId:K,companyId:v,companyName:T,entityType:M})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:Y.length,isLoading:G}),o.jsxRuntimeExports.jsx(kg,{})]}),o.jsxRuntimeExports.jsx($g,{onClick:V=>{V.preventDefault(),b(e)},children:o.jsxRuntimeExports.jsx(Eg,{className:"passportIcon"})})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:ae,itemKey:W.key,style:{left:t.Space.sp4},onElementClick:fe}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Le("subscription",W.key,v),addThreadRequestThreadId:l,itemKey:W.key,onAddThreadClick:be})]},$);case"status":return o.jsxRuntimeExports.jsxs(ut,{ref:V=>{x(v,W.key,V)},columnWidth:W.width,windowSize:E,isThreadOpen:Z||$e,isThreadAllowed:W.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,W.key),children:[H.status.code?o.jsxRuntimeExports.jsx(jr,{textColor:t.getCockpitColor(H.status.code),children:H.status.name.toUpperCase()}):lo.hyphen,te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:W.key,elementThreadId:$,threadStyle:ve?{right:t.Space.sp0}:void 0})]},$);case"controller":return o.jsxRuntimeExports.jsxs(ut,{ref:V=>{x(v,W.key,V)},columnWidth:W.width,windowSize:E,isThreadOpen:Z||$e,isThreadAllowed:W.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,W.key),children:[o.jsxRuntimeExports.jsx(t.UserMultiSelectField,{name:se(Q,"controller"),value:D.controller,placeholderLabel:pg.controller,pickerStyles:{titleTextStyle:t.textStyles.largeRegular,multiValueLabelTitleStyle:t.textStyles.largeRegular}}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:W.key,elementThreadId:$,threadStyle:ve?{right:t.Space.sp0}:void 0})]},$);case"plans":return o.jsxRuntimeExports.jsxs(ut,{ref:V=>{x(v,W.key,V)},columnWidth:W.width,windowSize:E,isThreadOpen:Z||$e,isThreadAllowed:W.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,W.key),children:[o.jsxRuntimeExports.jsx(Cr,{children:H.plansWithStatus.length>0?o.jsxRuntimeExports.jsx(gr,{plansAndAddonNames:H.plansWithStatus,isCollapsed:a,rowIndex:r,onCollapseToggled:h,showCollapseToggle:Sr(e,"plans"),companyId:v,tenantId:A,onPlanOrAddOnClicked:C}):lo.hyphen}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:W.key,elementThreadId:$,threadStyle:ve?{right:t.Space.sp0}:void 0})]},$);case"planLowerLimit":return o.jsxRuntimeExports.jsxs(ut,{ref:V=>{x(v,W.key,V)},columnWidth:W.width,windowSize:E,isThreadOpen:Z||$e,isThreadAllowed:W.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,W.key),children:[o.jsxRuntimeExports.jsx(Tn,{widthWrapper:W.width,windowSize:E,textColor:t.getCockpitColor("lowerLimit"),children:t.amountToString("0,0",H.slabLowerLimit)}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:W.key,elementThreadId:$,threadStyle:ve?{right:t.Space.sp0}:void 0})]},$);case"planHigherLimit":return o.jsxRuntimeExports.jsxs(ut,{ref:V=>{x(v,W.key,V)},columnWidth:W.width,windowSize:E,isThreadOpen:Z||$e,isThreadAllowed:W.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,W.key),children:[o.jsxRuntimeExports.jsx(Tn,{widthWrapper:W.width,windowSize:E,textColor:t.getCockpitColor("upperLimit"),children:t.amountToString("0,0",H.slabUpperLimit)}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:W.key,elementThreadId:$,threadStyle:ve?{right:t.Space.sp0}:void 0})]},$);case"avg2MonthExpenses":return o.jsxRuntimeExports.jsxs(ut,{ref:V=>{x(v,W.key,V)},columnWidth:W.width,windowSize:E,isThreadOpen:Z||$e,isThreadAllowed:W.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,W.key),children:[o.jsxRuntimeExports.jsx(Tn,{widthWrapper:W.width,windowSize:E,textColor:t.getCockpitColor("avg2MonthExpenses"),children:t.amountToString("0,0",H.avg2MonthExpenses)}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:W.key,elementThreadId:$,threadStyle:ve?{right:t.Space.sp0}:void 0})]},$);case"addons":return o.jsxRuntimeExports.jsxs(ut,{ref:V=>{x(v,W.key,V)},columnWidth:W.width,windowSize:E,isThreadOpen:Z||$e,isThreadAllowed:W.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,W.key),children:[o.jsxRuntimeExports.jsx(Cr,{children:H.addonsWithStatus.length>0?o.jsxRuntimeExports.jsx(gr,{plansAndAddonNames:H.addonsWithStatus,isCollapsed:a,rowIndex:r,onCollapseToggled:h,showCollapseToggle:Sr(e,"addons"),companyId:v,tenantId:A,onPlanOrAddOnClicked:C}):lo.hyphen}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:W.key,elementThreadId:$,threadStyle:ve?{right:t.Space.sp0}:void 0})]},$);case"upgradeStatus":return o.jsxRuntimeExports.jsxs(ut,{ref:V=>{x(v,W.key,V)},columnWidth:W.width,windowSize:E,isThreadOpen:Z||$e,isThreadAllowed:W.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,W.key),children:[o.jsxRuntimeExports.jsx(fr,{children:H.recommendedActionName?o.jsxRuntimeExports.jsx(jr,{textColor:t.getCockpitColor(H.recommendedActionCode),onClick:V=>{V.preventDefault(),A!=null&&H.recommendedActionCode==="upgrade"&&C(v,A)},code:H.recommendedActionCode,children:H.recommendedActionName}):lo.hyphen}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:W.key,elementThreadId:$,threadStyle:ve?{right:t.Space.sp0}:void 0})]},$);case"monthlyRecurringRevenue":return o.jsxRuntimeExports.jsxs(ut,{ref:V=>{x(v,W.key,V)},columnWidth:W.width,windowSize:E,isThreadOpen:Z||$e,isThreadAllowed:W.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,W.key),children:[o.jsxRuntimeExports.jsxs(fr,{children:[o.jsxRuntimeExports.jsx(t.LargeRegular,{children:t.amountToString("0,0",H.monthlyRecurringRevenue)}),H.totalDues.amount>0?o.jsxRuntimeExports.jsx(vg,{children:t.amountToString("0,0",H.totalDues).concat(lo.space).concat(ug)}):null]}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:W.key,elementThreadId:$,threadStyle:ve?{right:t.Space.sp0}:void 0})]},$);default:return null}})})})})})},xg=e=>{const n={plansWithStatus:[],addonsWithStatus:[]};return e.forEach(r=>{const i=r.plan?.plan.name??"",a=r.subscription.subscription.status.code;i!=null&&n.plansWithStatus.push({name:i,status:a}),r.addOns.forEach(d=>{n.addonsWithStatus.push({name:d.addOn.name,status:a})})}),n},hg=e=>{const n={};return e.reduce((i,a)=>(i[a.code]=a.name,i),n)};function gg(e,n){return{controller:{allUsers:n,selectedUsers:e.controllers.map(r=>r.user)}}}function Sg(e,n){const r={};r.users=[];const i=n.split(".")[1],{selectedUsers:a,deSelectedUsers:d}=e[i];return d==null||d?.length==0?a.forEach(l=>{if(l.isUserSelectionUpdated===!0){const c=yr(i,l.userId,l.isRoleSelected);c!==void 0&&r.users?.push(c)}}):d.forEach(l=>{const c=yr(i,l.userId,l.isRoleSelected);c!==void 0&&r.users?.push(c)}),{users:r.users}}function yg(e){return e==="controller"}function yr(e,n,r){if(yg(e))return{isZeni:!0,role:e,userId:n,isSelected:r}}const fg=s.div``,Cg=s(t.LargeMediumSp)`
|
|
2041
2041
|
word-break: break-word;
|
|
2042
2042
|
margin-right: 10px;
|
|
2043
2043
|
cursor: pointer;
|
|
@@ -2210,7 +2210,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2210
2210
|
`,Pn=s.div`
|
|
2211
2211
|
width: ${e=>e.width.valuePx(e.windowSize)};
|
|
2212
2212
|
color: ${e=>e.textColor.color.toString()};
|
|
2213
|
-
`,Ag={subscriptionRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{common:{headers:{comments:Dg}},collaboration:{threads:{placeholder:{addANewComment:Og,replyAComment:Ng},tooltip:{resolveComment:Mg,unResolveComment:zg}}}}=t.appLocale.getLocalizedStrings(),Fg=({subscriptionView:e,onColumnSortConfigChanged:n,onCollapseToggled:r,onCompanyNameClicked:i,onPassportIconClicked:a,onPlanOrAddOnClicked:d,onScroll:l,changeHandlers:c,initialOpenThreadRequest:p})=>{const m=t.useWindowSizeContext(),x=u.useRef(null),[
|
|
2213
|
+
`,Ag={subscriptionRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{common:{headers:{comments:Dg}},collaboration:{threads:{placeholder:{addANewComment:Og,replyAComment:Ng},tooltip:{resolveComment:Mg,unResolveComment:zg}}}}=t.appLocale.getLocalizedStrings(),Fg=({subscriptionView:e,onColumnSortConfigChanged:n,onCollapseToggled:r,onCompanyNameClicked:i,onPassportIconClicked:a,onPlanOrAddOnClicked:d,onScroll:l,changeHandlers:c,initialOpenThreadRequest:p})=>{const m=t.useWindowSizeContext(),x=u.useRef(null),[g,h]=u.useState(null),j=u.useRef(null),[b,C]=u.useState(null),S=!(m==="small"||m==="medium-compact");u.useEffect(()=>{x.current&&x.current.resetAfterIndex(0)},[e.uiState.isCollapsedByCompanyId,e.uiState.sortKey,e.uiState.sortOrder,e.companies.length]);const{uiState:y,totalMonthlyRecurringRevenue:f}=e,E=y.scrollYOffset??0,R=u.useCallback(P=>{const B=e.companies[P].company.company.companyInfo.companyId;r(B,!e.uiState.isCollapsedByCompanyId[B])},[r,e.companies,e.uiState.isCollapsedByCompanyId]),I=u.useCallback(P=>{const B=e.companies[P].company.company.companyInfo.name.length,k=e.companies[P].company.company.companyInfo.companyId,O=cg(e.companies[P]);return e.uiState.isCollapsedByCompanyId[k]?O.height:B>_t?Ie+32:Ie},[e.companies,e.uiState.isCollapsedByCompanyId]),{setOpenThread:A,setRequestToOpenThread:v,requestToOpenThread:T,isLoading:F}=u.useContext(t.ThreadsContext);u.useEffect(()=>{p!=null&&e.fetchState==="Completed"&&F===!1&&v(p)},[p,e.fetchState,F,v]);const[D,K]=u.useState(void 0),M=u.useRef([]),Y=u.useMemo(()=>({makeCompanyNameSticky:S,uiState:y,totalMonthlyRecurringRevenue:f,onColumnSortConfigChanged:n}),[S,y,f,n]),G=u.useCallback((P,B,k)=>{const O=e.companies.findIndex(Z=>Z.company.company.companyInfo.companyId===P),z=jt.findIndex(Z=>Z.key===B);O!==-1&&z!==-1&&(M.current[O]==null?M.current[O]=[k]:M.current[O][z]=k)},[e.companies]),w=u.useCallback(()=>{j.current=null,v(null)},[v]);return u.useEffect(()=>{if(T!=null&&g!=null){const{companyId:P,entityType:B}=T,[k,O]=B.split("."),z=e.companies.findIndex(H=>H.company.company.companyInfo.companyId===P),Z=jt.findIndex(H=>H.key===O);z!==-1&&!(g.visibleStartIndex<=z&&g.visibleStopIndex>=z)&&x.current?.scrollToItem(z,"center"),setTimeout(()=>{const H=M.current[z]?.[0]?.getBoundingClientRect().bottom,L=M.current[z]?.[0]?.getBoundingClientRect().top;if(H!=null&&L!=null&&(window.innerHeight>=H&&window.innerHeight>=L||L<0)){const Q=M.current[z][Z];Q!=null&&(j.current={companyId:P,target:Q}),M.current[z][Z]?.scrollIntoView({block:"center",behavior:"auto"})}},0);const N=setInterval(()=>{const H=M.current[z]?.[Z]?.getBoundingClientRect().left,L=M.current[z]?.[Z]?.getBoundingClientRect().right,Q=M.current[z]?.[Z]?.offsetWidth;if(j.current?.companyId===P&&H!=null&&Q!=null&&L!=null&&(H<window.innerWidth-Q||L<window.innerWidth)){clearInterval(N);const se=T.threadId,X=T.onThreadShownCallback;se&&(v(null),A(T.threadId),X?.())}},500);setTimeout(()=>{clearInterval(N),v(null)},2e3)}},[T,g,A,v]),o.jsxRuntimeExports.jsx(_g,{children:o.jsxRuntimeExports.jsxs(Xi.Provider,{value:Y,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:P,width:B})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:P,innerElementType:qi,itemCount:e.companies.length,itemSize:I,onItemsRendered:k=>h(k),itemData:{subscriptionView:e,makeCompanyNameSticky:S,addThreadRequestThreadId:D,targetElement:j.current?.target,resetTargetElementFromNavigation:w,setElementRef:G,setAddThreadRequestThreadId:K,onCompanyNameClicked:i,onPassportIconClicked:a,changeHandlers:c,setNoteData:C,onCollapseToggledHandler:R,onPlanOrAddOnClicked:d},width:B,overscanCount:Bt,ref:x,onScroll:({scrollOffset:k})=>{l(k)},initialScrollOffset:E,children:Bg})}),b!=null?o.jsxRuntimeExports.jsx(Xe.RoomProvider,{id:b.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${b.companyName} ${Dg}`,filter:{application:"cockpit",companyId:b.companyId,entityType:b.entityType,isGlobalComment:!1,tab:"subscription"},isLoading:!1,threadMetadata:{companyName:b.companyName,companyId:b.companyId,entityId:b.companyId,entityType:b.entityType,isGlobalComment:!1,application:"cockpit",tab:"subscription",url:window.location.href},textOverrides:{composerPlaceholder:Og,replyComposerPlaceholder:Ng,threadResolve:Mg,threadUnResolve:zg},onThreadClick:P=>null,onCloseAllThreadsDrawer:()=>C(null)})}):null]})})},Xi=u.createContext(void 0),qi=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,totalMonthlyRecurringRevenue:c,onColumnSortConfigChanged:p}=u.useContext(Xi);return o.jsxRuntimeExports.jsxs(Wg,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(Qh,{companyNameSticky:d,onColumnSortConfigChanged:p,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder}}),o.jsxRuntimeExports.jsx(Ug,{children:r}),o.jsxRuntimeExports.jsx(Tg,{companyNameSticky:d,totalMRRAmount:t.amountToString("0,0",c)})]})});qi.displayName="Subscription list view inner element type";const Bg=({index:e,data:n,style:r})=>{const i=t.useWindowSizeContext(),{setNoteData:a,subscriptionView:d,makeCompanyNameSticky:l,addThreadRequestThreadId:c,targetElement:p,resetTargetElementFromNavigation:m,setElementRef:x,changeHandlers:g,onCompanyNameClicked:h,onPassportIconClicked:j,onPlanOrAddOnClicked:b,setAddThreadRequestThreadId:C,onCollapseToggledHandler:S}=n,y=d.companies[e],{companyId:f}=y.company.company.companyInfo,E=d.uiState.isCollapsedByCompanyId[f]===!0;return o.jsxRuntimeExports.jsx(Vg,{isCollapsed:E,style:{...r,width:"fit-content",minWidth:"100%",padding:`${t.Space.sp0} ${Ag.subscriptionRightPadding.valuePx(i)} ${t.Space.sp3} ${t.Space.sp0}`},children:o.jsxRuntimeExports.jsx(mg,{companyView:d.companies[e],allUsers:d.zeniUsers.values,rowIndex:e,companyNameSticky:l,isCollapsed:E,onCollapseToggled:S,onCompanyNameClicked:h,onPassportIconClicked:j,onPlanOrAddOnClicked:b,changeHandlers:g,addThreadRequestThreadId:c,targetElementFromNavigation:p,resetTargetElementFromNavigation:m,setNoteData:a,setElementRef:x,setAddThreadRequestThreadId:C,totalHeight:typeof r.height=="number"?r.height:Ie})},f)},_g=s.div`
|
|
2214
2214
|
/** Subtract top so list can occupy remaining available height */
|
|
2215
2215
|
height: calc(100vh - 110px);
|
|
2216
2216
|
max-width: 99.9%;
|
|
@@ -2241,7 +2241,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2241
2241
|
height: calc(100vh - 45px);
|
|
2242
2242
|
overflow-y: hidden;
|
|
2243
2243
|
background-color: ${e=>e.theme.colors.grey4};
|
|
2244
|
-
`,Qg=({headerData:e,headerActions:n,initialOpenThreadRequest:r,subscriptionPageActions:i,subscriptionPageData:a})=>{const{subscriptionView:d}=a,{onColumnSortConfigChanged:l,changeHandlers:c,onScroll:p,onCompanyNameClicked:m,onPassportIconClicked:x,onCockpitReloadData:
|
|
2244
|
+
`,Qg=({headerData:e,headerActions:n,initialOpenThreadRequest:r,subscriptionPageActions:i,subscriptionPageData:a})=>{const{subscriptionView:d}=a,{onColumnSortConfigChanged:l,changeHandlers:c,onScroll:p,onCompanyNameClicked:m,onPassportIconClicked:x,onCockpitReloadData:g,onPlanOrAddOnClicked:h,onCollapseToggled:j,onFiltersChange:b}=i,C=d.uiState.filterText,S=d.uiState.filters,y=d.fetchState==="Completed"&&d.zeniUsers.fetchState==="Completed";return n.filterActions&&(n.filterActions.getCategoryWiseOptions=()=>e1(d)),o.jsxRuntimeExports.jsxs(qg,{children:[o.jsxRuntimeExports.jsx(dt,{headerActions:{...n},headerData:{...e,filterData:{filters:S,filterText:C},companiesLoaded:y,allTabOptions:e.allTabOptions??rt,selectedTabOption:"subscription"}}),o.jsxRuntimeExports.jsx(Jg,{initialOpenThreadRequest:r,isFilterApplied:S?.categories!=null,subscriptionView:d,changeHandlers:c,onClearFilter:()=>b("subscription",{}),onCockpitReloadData:g,onCollapseToggled:j,onColumnSortConfigChanged:l,onCompanyNameClicked:m,onPassportIconClicked:x,onPlanOrAddOnClicked:h,onScroll:p})]})},Jg=({subscriptionView:e,isFilterApplied:n,initialOpenThreadRequest:r,onColumnSortConfigChanged:i,onCollapseToggled:a,onCockpitReloadData:d,changeHandlers:l,onScroll:c,onPlanOrAddOnClicked:p,onCompanyNameClicked:m,onPassportIconClicked:x,onClearFilter:g})=>{const h=t.useWindowSizeContext();return e.fetchState==="Error"?o.jsxRuntimeExports.jsx($t,{onCockpitReloadData:d,selectedCockpitOption:"subscription"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"?o.jsxRuntimeExports.jsx(Zg,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})}):e.companies.length===0?n?o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchOnFilters,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine,filtersApplied:!0,onClearFilter:g}):o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextFirstLine,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine}):o.jsxRuntimeExports.jsx(Xg,{windowSize:h,children:o.jsxRuntimeExports.jsx(Yg,{initialOpenThreadRequest:r,subscriptionView:e,changeHandlers:l,onCollapseToggled:a,onColumnSortConfigChanged:i,onCompanyNameClicked:m,onPassportIconClicked:x,onPlanOrAddOnClicked:p,onScroll:c})})},e1=e=>{const n=e.zeniUsers.values,r=gi,{companies:i}=e;return r.reduce((a,d)=>{switch(d.value){case"statusCode":return i.length===0?{...a,[d.value]:[]}:{...a,[d.value]:i[0].primarySubscription?.subscription.subscription.schema.status.map(l=>{const c=l;return{label:c.name,value:c.code}})};case"controllerUserIds":{if(i.length===0)return{...a,[d.value]:[]};const l=n.map(c=>({label:c.firstName||c.lastName?`${c.firstName} ${c.lastName}`:c.email,value:c.userId,photo:c.photo,email:c.email}));return{...a,[d.value]:l}}case"recommendedActionCode":return i.length===0?{...a,[d.value]:[]}:{...a,[d.value]:i[0].primarySubscription?.summary.schema.recommendedAction.map(l=>{const c=l;return{label:c.name,value:c.code}})};case"monthlyRecurringRevenue":return{...a,[d.value]:hs};case"subscriptionPlans":return{...a,[d.value]:e.subscriptionPlans.map(l=>({label:l.name,value:l.subscriptionPlanId}))};case"subscriptionAddOns":return{...a,[d.value]:e.subscriptionAddOns.map(l=>({label:l.name,value:l.subscriptionAddOnId}))};case"avg2MonthExpenses":return{...a,[d.value]:Ja};case"slabLowerLimit":case"slabUpperLimit":return{...a,[d.value]:el};default:return{...a,[d.value]:[]}}},{})},t1={width:new t.ResponsiveSized(343,580,756)};function o1({subscriptionUpdateData:e,subscriptionTermEndDate:n,isSubscriptionDetailsChanged:r,isDisabled:i,sectionId:a,style:d}){const l=t.useWindowSizeContext(),{subscriptionUpdate:{updatePlan:{applyChanges:c}},dateFormat:{visual:p}}=t.appLocale.getLocalizedStrings(),m=n?.format(p.MMMDCommaYYYYformat),x=m?`${c.nextRenewal} (${m})`:c.nextRenewal;let g=e?.applyEndOfTerm===!0?"readonly":i;return r===!1&&(g="disabled"),o.jsxRuntimeExports.jsxs(n1,{style:d,children:[o.jsxRuntimeExports.jsx(s1,{children:c.title}),o.jsxRuntimeExports.jsxs(i1,{children:[o.jsxRuntimeExports.jsx(t.LabeledRadioField,{isDisabled:i,label:{label:x},style:{padding:`${t.Space.sp3} ${t.Space.sp0}`},radioField:{name:In(a,"changeType"),id:"applyEndOfTerm",value:"applyEndOfTerm"}}),o.jsxRuntimeExports.jsx(t.LabeledRadioField,{isDisabled:r===!1?"disabled":i,label:{label:c.immediately},style:{paddingTop:t.Space.sp3},radioField:{name:In(a,"changeType"),id:"applyImmediately",value:"applyImmediately"}}),o.jsxRuntimeExports.jsx(t.LabeledUnSafeCheckBoxField,{isDisabled:g,label:{label:c.applyProRated},checkBoxField:{name:In(a,"shouldProrate"),defaultChecked:e?.shouldProrate===!0,style:{paddingLeft:t.Space.sp4}}}),o.jsxRuntimeExports.jsxs(r1,{size:l,isDisabled:r===!1?"disabled":i,children:[o.jsxRuntimeExports.jsx(An,{children:c.proRatedDescription}),o.jsxRuntimeExports.jsx(An,{children:c.proRatedText1}),o.jsxRuntimeExports.jsx(An,{children:c.proRatedText2})]})]})]})}const In=(e,n)=>`${e}.${n}`,n1=s.div`
|
|
2245
2245
|
display: flex;
|
|
2246
2246
|
flex-direction: column;
|
|
2247
2247
|
`,s1=s(t.ExtraLargeMedium)`
|
|
@@ -2263,7 +2263,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2263
2263
|
`,i1=s.div`
|
|
2264
2264
|
display: flex;
|
|
2265
2265
|
flex-direction: column;
|
|
2266
|
-
`,Qi={infoLabel:new t.ResponsiveSizedStyle("smallRegular","standardRegular"),selectFieldInput:new t.ResponsiveSizedStyle("standardRegular","largeRegular")},a1=({name:e,registerOptions:n,defaultValue:r,isDisabled:i,style:a,placeholder:d,valueToInfo:l,valueToId:c,showEmptyState:p,additionalLabelInfo:m,customStyleConfig:x,showDownChevronWithValue:
|
|
2266
|
+
`,Qi={infoLabel:new t.ResponsiveSizedStyle("smallRegular","standardRegular"),selectFieldInput:new t.ResponsiveSizedStyle("standardRegular","largeRegular")},a1=({name:e,registerOptions:n,defaultValue:r,isDisabled:i,style:a,placeholder:d,valueToInfo:l,valueToId:c,showEmptyState:p,additionalLabelInfo:m,customStyleConfig:x,showDownChevronWithValue:g,customPlaceholderString:h,allowEmpty:j=!0,tooltip:b,menuPortal:C,disableCurrentOption:S})=>{const{control:y,formState:{errors:f,dirtyFields:E}}=o.useFormContext(),R=t.useWindowSizeContext(),I=o.useTheme(),[A,v]=u.useState(!1),T=o.has(E,e),F=o.has(f,e??""),D=t.appLocale.getLocalizedStrings().dropDowns,K=u.useCallback(P=>({value:P.value,label:P.label,info:l?.(P.value)??"",id:c?.(P.value)??null,isDisabled:P.isDisabled,additionalNote:P?.additionalNote,isOptionRecommended:P.isOptionRecommended}),[l,c]),M=P=>P.map(B=>({label:B.label,options:B.options.map(k=>K(k))})),Y=P=>{if(P==null||!P)return;let B=[];return r.allOptions.forEach(k=>{B=B.concat(k.options)}),{value:P,label:B.find(k=>k.value===P)?.label??P,info:l?.(P)??""}};if(p===!0&&A===!1&&T===!1&&!r.selectedOption&&i==null)return o.jsxRuntimeExports.jsx(t.ItemWithButton,{style:a,buttonTitle:D.add,onClick:()=>v(!0),name:e});const G={...x,container:P=>({...P,width:"100%",...a}),menu:(P,B)=>({...P,backgroundColor:I.colors.grey5,borderRadius:"6px",whiteSpace:"nowrap",zIndex:2,width:"100%",margin:0,...x?.menu?.(P,B)}),menuList:(P,B)=>({...P,borderRadius:"6px",...x?.menuList?.(P,B)}),group:P=>({...P,borderBottom:`1px solid ${I.colors.grey3}`,paddingBottom:0}),control:(P,B)=>({...P,borderRadius:"6px",...x?.control?.(P,B)})},w={hasError:F,showDownChevronWithValue:g,customPlaceholderString:h};return o.jsxRuntimeExports.jsx(o.Controller,{name:e,control:y,defaultValue:r,rules:n,render:({field:{onChange:P,onBlur:B,value:k,ref:O}})=>{const z=k;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[u.createElement(o.StateManagedSelect$1,{...w,ref:O,isMulti:!1,isSearchable:!0,isClearable:!0,controlShouldRenderValue:!0,placeholder:d,value:Y(z.selectedOption),options:M(z.allOptions),onChange:Z=>{Z==null||Z?.value!=null&&z?.selectedOption===Z.value?j===!0&&P({selectedOption:void 0,allOptions:z.allOptions}):P({selectedOption:Z.value,allOptions:z.allOptions})},key:o.nanoid(),tabSelectsValue:!1,openMenuOnFocus:!0,classNamePrefix:"grouped-single-select-field",onBlur:B,menuPlacement:"auto",menuPortalTarget:C,maxMenuHeight:288,menuShouldScrollIntoView:!0,closeMenuOnSelect:!0,components:{Control:l1,Option:h1,Input:d1,Group:p1,GroupHeading:u1,SingleValue:Z=>m1(Z,b),ValueContainer:c1,DropdownIndicator:M1,IndicatorSeparator:z1,Placeholder:x1,ClearIndicator:F1},hideSelectedOptions:!1,styles:G,isDisabled:i!=null,isOptionDisabled:Z=>S?.(Z.value)??!1}),o.jsxRuntimeExports.jsx(k1,{size:R,children:m})]})}})},l1=e=>{const{menuIsOpen:n,isFocused:r,isDisabled:i,selectProps:a,data:d,options:l}=e,{value:c,hasError:p,customPlaceholderString:m}=a;let x=[];l.forEach(j=>{x=x.concat(j.options)});const g=x.find(j=>j.value===d?.value),h=t.useWindowSizeContext();return o.jsxRuntimeExports.jsx(C1,{title:m!=null&&c!=null?c.label:void 0,windowSize:h,menuIsOpen:n,isFocused:r,isDisabled:i,selectedValue:c,hasError:p,customPlaceholderString:m,isRecommended:g?.isOptionRecommended,children:o.jsxRuntimeExports.jsx(o.components.Control,{...e,className:"select-control",children:e.children})})},c1=e=>{const{selectProps:n,children:r}=e,{showDownChevronWithValue:i}=n;return o.jsxRuntimeExports.jsxs(o.components.ValueContainer,{...e,className:"select-value-container",children:[r,i===!0?o.jsxRuntimeExports.jsx(t.LargeRegular,{children:o.jsxRuntimeExports.jsx(j1,{})}):null]})},d1=e=>{const{selectProps:n,innerRef:r,innerProps:i}=e,{placeholder:a,value:d,customPlaceholderString:l,menuIsOpen:c,onMenuOpen:p,hasError:m}=n;return l!=null&&d==null&&c===!1?o.jsxRuntimeExports.jsx(V1,{ref:r,...i,onClick:p,style:{display:"flex",width:"100%",height:"100%",alignItems:"center",justifyContent:"flex-start",cursor:"pointer"},className:"custom-placeholder",children:o.jsxRuntimeExports.jsxs(B1,{children:[o.jsxRuntimeExports.jsx(_1,{hasError:m}),o.jsxRuntimeExports.jsx(W1,{hasError:m,children:l})]})}):o.jsxRuntimeExports.jsx(o.components.Input,{...e,autoComplete:"new-password",autoFocus:c,placeholder:d==null?a:void 0,children:e.children})},p1=e=>o.jsxRuntimeExports.jsx(o.components.Group,{...e,children:e.children}),u1=e=>{const[n,r]=u.useState(!0);return o.jsxRuntimeExports.jsx(T1,{className:"group-heading-container",isGroupOpen:n,onClick:()=>r(!n),children:o.jsxRuntimeExports.jsxs(o.components.GroupHeading,{...e,children:[o.jsxRuntimeExports.jsx(L1,{isGroupOpen:n,children:o.jsxRuntimeExports.jsx(P1,{className:"close-tick-icon"})}),e.children]})})},m1=({children:e,...n},r)=>{const i=r==null||n.selectProps.menuIsOpen===!0?e:r.sticky===!0?o.jsxRuntimeExports.jsx(g1,{title:r.text,children:e}):o.jsxRuntimeExports.jsx(t.Tooltip,{style:{padding:t.Space.sp3},title:r.text,placement:"top",children:e});return o.jsxRuntimeExports.jsx(o.components.SingleValue,{title:e,...n,children:i})},x1=()=>null,h1=e=>{const{data:n,isSelected:r,options:i,isDisabled:a,isFocused:d,selectProps:l}=e,{customPlaceholderString:c}=l;let p=[];i.forEach(x=>{p=p.concat(x.options)});const m=p.find(x=>x.value===n.value);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(b1,{title:c!=null?e.label:void 0,className:"select-option-wrapper",isFocused:d,isSelected:r,isDisabled:a,isOptionRecommended:m?.isOptionRecommended===!0,showBottomBorder:m?.additionalNote==null||m?.isOptionRecommended===!1,children:o.jsxRuntimeExports.jsx(o.components.Option,{...e,className:"select-option",children:o.jsxRuntimeExports.jsxs(R1,{children:[o.jsxRuntimeExports.jsxs(v1,{isSelected:r,children:[o.jsxRuntimeExports.jsx($1,{isSelected:r,isDisabled:a,children:e.label}),d===!0&&m?.id!=null&&o.jsxRuntimeExports.jsx(N1,{children:m.id}),d===!0&&m?.info?o.jsxRuntimeExports.jsx(w1,{isSelected:!!r,children:m?.info}):null]}),m?.isOptionRecommended===!0?o.jsxRuntimeExports.jsx(O1,{}):null,r&&m?.additionalNote==null?o.jsxRuntimeExports.jsxs(I1,{children:[o.jsxRuntimeExports.jsx(A1,{className:"right-tick-icon"}),o.jsxRuntimeExports.jsx(D1,{className:"close-tick-icon"})]}):null]})})}),m?.isOptionRecommended===!0&&m.additionalNote!=null?o.jsxRuntimeExports.jsx(E1,{isSelected:r,isDisabled:a,children:m?.additionalNote}):null]})},g1=({children:e,title:n})=>o.jsxRuntimeExports.jsxs(S1,{children:[o.jsxRuntimeExports.jsxs(y1,{children:[n,o.jsxRuntimeExports.jsx(f1,{})]}),e]}),S1=s.div`
|
|
2267
2267
|
position: relative;
|
|
2268
2268
|
display: contents;
|
|
2269
2269
|
`,y1=s.div`
|
|
@@ -2498,7 +2498,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2498
2498
|
color: ${e=>e.hasError?t.Colors.important:e.theme.colors.grey1};
|
|
2499
2499
|
`,W1=s(t.LargeRegular)`
|
|
2500
2500
|
color: ${e=>e.hasError?t.Colors.important:e.theme.colors.grey1};
|
|
2501
|
-
`,V1=s.div``,gt={width:new t.ResponsiveSized(343,580,756),height:new t.ResponsiveSized(t.sp[6],t.sp[6]),controlHeight:new t.ResponsiveSized(t.sp[6],t.sp[6]),paddingTopBottom:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginTop:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginBottom:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginRight:new t.ResponsiveSized(t.sp[2],t.sp[2]),paddingRight:new t.ResponsiveSized(t.sp[0],t.sp[2]),labelMarginLeft:new t.ResponsiveSized(t.sp[3],t.sp[4]),labelMarginRight:new t.ResponsiveSized(t.sp[4],t.sp[4]),labelMarginTop:new t.ResponsiveSized(t.sp[2],t.sp[2])},U1={infoLabel:new t.ResponsiveSizedStyle("smallRegular","standardRegular")};function Ji({isDisabled:e,label:n,hideLabel:r=!1,groupedSingleSelectField:i,style:a,controlWidth:d,additionalLabelInfo:l,valueToAdditionalLabel:c,disableCurrentOption:p,fullWidthSelect:m=!0}){const x=t.useWindowSizeContext(),{formState:{errors:
|
|
2501
|
+
`,V1=s.div``,gt={width:new t.ResponsiveSized(343,580,756),height:new t.ResponsiveSized(t.sp[6],t.sp[6]),controlHeight:new t.ResponsiveSized(t.sp[6],t.sp[6]),paddingTopBottom:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginTop:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginBottom:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginRight:new t.ResponsiveSized(t.sp[2],t.sp[2]),paddingRight:new t.ResponsiveSized(t.sp[0],t.sp[2]),labelMarginLeft:new t.ResponsiveSized(t.sp[3],t.sp[4]),labelMarginRight:new t.ResponsiveSized(t.sp[4],t.sp[4]),labelMarginTop:new t.ResponsiveSized(t.sp[2],t.sp[2])},U1={infoLabel:new t.ResponsiveSizedStyle("smallRegular","standardRegular")};function Ji({isDisabled:e,label:n,hideLabel:r=!1,groupedSingleSelectField:i,style:a,controlWidth:d,additionalLabelInfo:l,valueToAdditionalLabel:c,disableCurrentOption:p,fullWidthSelect:m=!0}){const x=t.useWindowSizeContext(),{formState:{errors:g}}=o.useFormContext(),h=o.has(g,i.name);return o.jsxRuntimeExports.jsxs(H1,{size:x,style:a,isDisabled:e!=null,controlWidth:d,isError:h,children:[!r&&o.jsxRuntimeExports.jsx(t.Label,{isDisabled:e,label:n.label,htmlFor:i.name,style:{marginLeft:gt.labelMarginLeft.value(x),marginRight:gt.labelMarginRight.value(x),marginTop:gt.labelMarginTop.value(x),width:n.width??"auto"}}),o.jsxRuntimeExports.jsxs(K1,{fullWidthSelect:m,labelWidth:n.width,children:[o.jsxRuntimeExports.jsx(a1,{...i,isDisabled:e,style:{display:"flex",flexGrow:1,width:"-webkit-fill-available",height:gt.controlHeight.value(x),cursor:"inherit"},additionalLabelInfo:l,disableCurrentOption:p}),i.defaultValue.selectedOption!=null?o.jsxRuntimeExports.jsx(G1,{size:x,isError:h,children:c?.(i.defaultValue.selectedOption)}):null]})]})}const H1=s.div`
|
|
2502
2502
|
display: flex;
|
|
2503
2503
|
flex-direction: row;
|
|
2504
2504
|
align-items: flex-start;
|
|
@@ -2549,7 +2549,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2549
2549
|
${e=>`${U1.infoLabel.style(e.size)}`};
|
|
2550
2550
|
padding-right: ${t.Space.sp3};
|
|
2551
2551
|
text-align: right;
|
|
2552
|
-
`,nt={width:new t.ResponsiveSized(343,580,756),height:new t.ResponsiveSized(t.sp[6],t.sp[6]),controlHeight:new t.ResponsiveSized(t.sp[6],t.sp[6]),paddingTopBottom:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginTop:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginBottom:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginRight:new t.ResponsiveSized(t.sp[2],t.sp[2]),labelMarginLeft:new t.ResponsiveSized(t.sp[3],t.sp[4]),labelMarginRight:new t.ResponsiveSized(t.sp[4],t.sp[4]),labelMarginTop:new t.ResponsiveSized(t.sp[2],t.sp[2])},Y1={infoLabel:new t.ResponsiveSizedStyle("smallRegular","standardRegular")};function ea({isDisabled:e,label:n,singleSelectPickerField:r,allOptions:i,defaultValues:a,valueToAdditionalLabel:d,style:l}){const c=t.useWindowSizeContext(),{formState:{errors:p},control:m}=o.useFormContext(),{fields:x,replace:
|
|
2552
|
+
`,nt={width:new t.ResponsiveSized(343,580,756),height:new t.ResponsiveSized(t.sp[6],t.sp[6]),controlHeight:new t.ResponsiveSized(t.sp[6],t.sp[6]),paddingTopBottom:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginTop:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginBottom:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginRight:new t.ResponsiveSized(t.sp[2],t.sp[2]),labelMarginLeft:new t.ResponsiveSized(t.sp[3],t.sp[4]),labelMarginRight:new t.ResponsiveSized(t.sp[4],t.sp[4]),labelMarginTop:new t.ResponsiveSized(t.sp[2],t.sp[2])},Y1={infoLabel:new t.ResponsiveSizedStyle("smallRegular","standardRegular")};function ea({isDisabled:e,label:n,singleSelectPickerField:r,allOptions:i,defaultValues:a,valueToAdditionalLabel:d,style:l}){const c=t.useWindowSizeContext(),{formState:{errors:p},control:m}=o.useFormContext(),{fields:x,replace:g}=o.useFieldArray({control:m,name:r.name}),h=o.has(p,r.name);return u.useEffect(()=>{const j=x.map(b=>b.selectedOption);if(!o.isEqual(j,a)){const b=a.map(C=>({selectedOption:C,allOptions:Dn(i,a,C)}));g(b)}},[i,a,x,g]),o.jsxRuntimeExports.jsxs(X1,{size:c,style:l,isDisabled:e!=null,children:[o.jsxRuntimeExports.jsx(t.Label,{isDisabled:e,label:n.label,htmlFor:r.name,style:{marginLeft:nt.labelMarginLeft.value(c),marginRight:nt.labelMarginRight.value(c),marginTop:nt.labelMarginTop.value(c),width:n.width??"auto"}}),o.jsxRuntimeExports.jsxs(q1,{size:c,labelWidth:n.width,children:[x.map((j,b)=>{const C=a[b];return o.jsxRuntimeExports.jsxs(Rr,{children:[u.createElement(t.SingleSelectPickerField,{...r,name:`${r.name}.${b}`,key:j.id,defaultValue:{selectedOption:C,allOptions:Dn(i,a,C)},isDisabled:e,style:{display:"flex",flexGrow:1,width:"-webkit-fill-available",height:nt.controlHeight.value(c),cursor:"inherit"}}),C!=null?o.jsxRuntimeExports.jsx(Q1,{size:c,isError:h,children:d?.(C)}):null]},`${r.name}.${b}`)}),e==null?o.jsxRuntimeExports.jsx(Rr,{children:o.jsxRuntimeExports.jsx(t.SingleSelectPickerField,{...r,showEmptyState:x.length!==0,name:`${r.name}.${a.length}`,defaultValue:{selectedOption:void 0,allOptions:Dn(i,a)},isDisabled:e,style:{display:"flex",flexGrow:1,width:"-webkit-fill-available",height:nt.controlHeight.value(c),cursor:"inherit"}})},`${r.name}.${a.length}`):o.jsxRuntimeExports.jsx(Z1,{numberOfFields:x.length,placeholder:r.placeholder})]})]})}const Z1=({numberOfFields:e,placeholder:n})=>{const r=t.useWindowSizeContext();return e>0||n==null?o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{}):o.jsxRuntimeExports.jsx(J1,{size:r,children:n})},X1=s.div`
|
|
2553
2553
|
display: flex;
|
|
2554
2554
|
flex-direction: row;
|
|
2555
2555
|
align-items: flex-start;
|
|
@@ -2608,7 +2608,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2608
2608
|
justify-content: flex-end;
|
|
2609
2609
|
align-items: center;
|
|
2610
2610
|
user-select: none;
|
|
2611
|
-
`,Dn=(e,n,r)=>e.map(i=>({...i,isDisabled:i.value!==r&&n.includes(i.value)})),On={labelWidth:new t.ResponsiveSized(115,145,155),mediumLabelWidth:new t.ResponsiveSized(140,160,170),largeLabelWidth:new t.ResponsiveSized(160,210,210),paddingBottom:new t.ResponsiveSized(t.sp[3],t.sp[2])};function eS({sectionId:e,isDisabled:n,subscriptionUpdateData:r,subscriptionMetaDetails:i,recommendedSubscriptionPlanId:a,style:d}){const l=t.useWindowSizeContext(),c=t.appLocale.getLocalizedStrings().subscriptionUpdate,{dropDowns:p}=t.appLocale.getLocalizedStrings(),{labels:m,placeholders:x}=c.dropDowns,
|
|
2611
|
+
`,Dn=(e,n,r)=>e.map(i=>({...i,isDisabled:i.value!==r&&n.includes(i.value)})),On={labelWidth:new t.ResponsiveSized(115,145,155),mediumLabelWidth:new t.ResponsiveSized(140,160,170),largeLabelWidth:new t.ResponsiveSized(160,210,210),paddingBottom:new t.ResponsiveSized(t.sp[3],t.sp[2])};function eS({sectionId:e,isDisabled:n,subscriptionUpdateData:r,subscriptionMetaDetails:i,recommendedSubscriptionPlanId:a,style:d}){const l=t.useWindowSizeContext(),c=t.appLocale.getLocalizedStrings().subscriptionUpdate,{dropDowns:p}=t.appLocale.getLocalizedStrings(),{labels:m,placeholders:x}=c.dropDowns,g=On.labelWidth.value(l),h=On.mediumLabelWidth.value(l),j=On.largeLabelWidth.value(l),{plans:b,addOns:C,coupons:S}=i;return o.jsxRuntimeExports.jsx(tS,{style:d,children:o.jsxRuntimeExports.jsxs(oS,{children:[o.jsxRuntimeExports.jsx(Ji,{label:{label:m.planName,width:h},isDisabled:n,groupedSingleSelectField:{name:Nn(e,"subscriptionPlan"),placeholder:x.selectPlan,valueToInfo:y=>{const f=b.find(E=>E.subscriptionPlanId===y);return t.amountToString("0,0.00",f?.price)},defaultValue:{selectedOption:r?.subscriptionPlanId,allOptions:to(b,a)},registerOptions:{required:!0,validate:y=>y!=null&&y.selectedOption!=null||n!=null}},valueToAdditionalLabel:y=>{const f=b.find(E=>E.subscriptionPlanId===y);return dn(f?.price,f?.period)??""}}),o.jsxRuntimeExports.jsx(Mn,{}),o.jsxRuntimeExports.jsx(ea,{label:{label:m.recurringAddOns,width:g},isDisabled:n,singleSelectPickerField:{name:Nn(e,"recurringAddOns"),placeholder:x.selectAddOn,valueToInfo:y=>{const f=C.find(E=>E.subscriptionAddOnId===y);return t.amountToString("0,0.00",f?.price)}},valueToAdditionalLabel:y=>{const f=C.find(E=>E.subscriptionAddOnId===y);return dn(f?.price,f?.period)??""},defaultValues:r?.subscriptionAddOnIds??[],allOptions:C.map(y=>({label:y.name,value:y.subscriptionAddOnId}))}),o.jsxRuntimeExports.jsx(Mn,{}),o.jsxRuntimeExports.jsx(t.LabeledItemWithButton,{isDisabled:"readonly",label:{label:m.nonRecurringAddOns,width:j},style:{opacity:.32},button:{buttonTitle:p.add,style:{pointerEvents:"none"}}}),o.jsxRuntimeExports.jsx(Mn,{}),o.jsxRuntimeExports.jsx(t.LabeledSingleSelectPickerField,{isDisabled:n,label:{label:m.coupon,width:g},singleSelectPickerField:{name:Nn(e,"coupon"),placeholder:x.selectCoupon,defaultValue:{selectedOption:r?.subscriptionCouponIds[0],allOptions:S.map(y=>({label:y.name,value:y.subscriptionCouponId}))}}})]})})}const Nn=(e,n)=>`${e}.${n}`,tS=s.div`
|
|
2612
2612
|
display: flex;
|
|
2613
2613
|
flex-direction: column;
|
|
2614
2614
|
padding-top: ${t.Space.sp3};
|
|
@@ -2626,7 +2626,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2626
2626
|
background-color: ${e=>e.theme.colors.grey3};
|
|
2627
2627
|
min-height: 1px;
|
|
2628
2628
|
max-height: 1px;
|
|
2629
|
-
`,to=(e,n)=>{const r=t.appLocale.getLocalizedStrings().subscriptionUpdate,{groups:i}=r.dropDowns,a=[];return n!=null&&a.push({label:i.recommendedPlan,options:e.filter(d=>d.subscriptionPlanId===n).map(d=>({label:d.name,value:d.subscriptionPlanId}))}),a.push({label:i.allPlans,options:e.filter(d=>d.subscriptionPlanId!==n).map(d=>({label:d.name,value:d.subscriptionPlanId}))}),a},dn=(e,n)=>e==null?void 0:`${(t.amountToString("0,0.00",e)+" "+nS(n)).trim()}`,nS=e=>{if(e==null)return"";const{count:n,unit:r}=e;return n===1?`/ ${r.substring(0,1).toUpperCase().concat(r.substring(1))}`:`/ ${r.substring(0,1).toUpperCase().concat(r.substring(1))} x ${n}`},$r="subscriptionUpdatePlanPage",pn="updatePlan",Dt="applyChanges";function sS(e){const n=t.useWindowSizeContext(),r=o.useTheme(),{localData:i,isDisabled:a,onSubscriptionDetailsChanged:d,onEstimateSuccess:l,onReviewClick:c,onBackClick:p,onResetClick:m}=e,[x,
|
|
2629
|
+
`,to=(e,n)=>{const r=t.appLocale.getLocalizedStrings().subscriptionUpdate,{groups:i}=r.dropDowns,a=[];return n!=null&&a.push({label:i.recommendedPlan,options:e.filter(d=>d.subscriptionPlanId===n).map(d=>({label:d.name,value:d.subscriptionPlanId}))}),a.push({label:i.allPlans,options:e.filter(d=>d.subscriptionPlanId!==n).map(d=>({label:d.name,value:d.subscriptionPlanId}))}),a},dn=(e,n)=>e==null?void 0:`${(t.amountToString("0,0.00",e)+" "+nS(n)).trim()}`,nS=e=>{if(e==null)return"";const{count:n,unit:r}=e;return n===1?`/ ${r.substring(0,1).toUpperCase().concat(r.substring(1))}`:`/ ${r.substring(0,1).toUpperCase().concat(r.substring(1))} x ${n}`},$r="subscriptionUpdatePlanPage",pn="updatePlan",Dt="applyChanges";function sS(e){const n=t.useWindowSizeContext(),r=o.useTheme(),{localData:i,isDisabled:a,onSubscriptionDetailsChanged:d,onEstimateSuccess:l,onReviewClick:c,onBackClick:p,onResetClick:m}=e,[x,g]=u.useState(void 0),h=u.useRef(null),{data:j,subscriptionDetail:b,fetchState:C,estimateStatus:S}=i,y=t.usePrevious(S.fetchState),f=t.usePrevious(C),E=o.useForm({mode:"all",reValidateMode:"onChange",defaultValues:u.useMemo(()=>wr(i),[i])});u.useEffect(()=>()=>{g(void 0)},[]),u.useEffect(()=>{f==="In-Progress"&&C==="Completed"&&E.reset(wr(i))},[f,C,E,i]),u.useEffect(()=>{y==="In-Progress"&&(S.fetchState==="Error"?x!==S.fetchState&&g(S.fetchState):S.fetchState==="Completed"&&(g(void 0),l()))},[x,y,S.fetchState,l]);const R=async(w,P)=>{if(w.includes(pn)||w.includes(Dt)){if(w.includes(Dt)){const{applyChanges:B}=P,{changeType:k,shouldProrate:O}=B;k==="applyImmediately"&&j?.applyEndOfTerm===!0&&O===!1?E.setValue(Dt,{...B,shouldProrate:!0},{shouldDirty:!0}):k==="applyEndOfTerm"&&j?.applyEndOfTerm===!1&&O===!0&&E.setValue(Dt,{...B,shouldProrate:!1},{shouldDirty:!0})}d(P)}};u.useEffect(()=>{const w=E.watch((P,{name:B})=>{B!=null&&P!=null&&o.defer(()=>R(B,P))});return()=>{w.unsubscribe()}});const I=E.handleSubmit(w=>{x!=null&&g(void 0),c()}),A=()=>M?.status.code!=="future"?o.jsxRuntimeExports.jsx(o1,{sectionId:Dt,style:{paddingBottom:t.Space.sp9},subscriptionUpdateData:j,subscriptionTermEndDate:M?.currentTerm?.end,isSubscriptionDetailsChanged:ta(i),isDisabled:a}):null,{updatePlan:v,snackBar:T,footer:F}=t.appLocale.getLocalizedStrings().subscriptionUpdate,{title:D}=v,K=b?.summary?.summary,M=b?.subscription.subscription,Y=b?.plan?.plan.subscriptionPlanId,G=K?.recommendedSubscriptionPlanId!=null&&Y===K?.primarySubscriptionPlanId?K?.recommendedSubscriptionPlanId:void 0;return o.jsxRuntimeExports.jsxs(rS,{children:[o.jsxRuntimeExports.jsx(t.NavBar,{title:D,backgroundColor:r.colors.grey4,style:{zIndex:3},onBackClick:p,scrollableContent:h,source:"SubscriptionUpdatePlanPage"}),x!=null?o.jsxRuntimeExports.jsx(t.SubscriptionSnackBar,{fetchState:x,customMessageText:S.error?.message??T.failedText,onRemoveSnackbar:()=>g(void 0)}):null,o.jsxRuntimeExports.jsx(aS,{ref:h,windowSize:n,children:C==="In-Progress"||C==="Not-Started"?o.jsxRuntimeExports.jsx(iS,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Large",start:!0})}):o.jsxRuntimeExports.jsx(o.FormProvider,{...E,children:o.jsxRuntimeExports.jsxs("form",{id:Er($r),onSubmit:I,children:[o.jsxRuntimeExports.jsx(eS,{sectionId:pn,subscriptionUpdateData:j,recommendedSubscriptionPlanId:G,subscriptionMetaDetails:oo(i),isDisabled:a}),o.jsxRuntimeExports.jsx(A,{})]})})}),t.formHasDirtyFields(E.formState.dirtyFields)||lS(i)?o.jsxRuntimeExports.jsx(t.Footer,{formId:Er($r),primaryBtn:{label:F.review,isLoading:S.fetchState==="In-Progress",isDisabled:e.isDisabled!=null&&S.fetchState!=="In-Progress"},cancelBtn:{label:F.cancel,shouldResetOnCancel:!0,onClick:()=>{E.reset(cS(i)),b!=null&&m(b)}}}):null]})}const rS=s.div`
|
|
2630
2630
|
display: flex;
|
|
2631
2631
|
min-height: 100%;
|
|
2632
2632
|
flex-direction: column;
|
|
@@ -2647,7 +2647,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2647
2647
|
justify-content: center;
|
|
2648
2648
|
height: 100%;
|
|
2649
2649
|
overflow-y: auto;
|
|
2650
|
-
`,Er=e=>`${e}_form`,wr=e=>{const{data:n,subscriptionDetail:r}=e,i=r?.summary?.summary,a=r?.subscription.subscription.subscriptionPlanId,{plans:d,addOns:l,coupons:c}=oo(e),p=i?.recommendedSubscriptionPlanId!=null&&a===i?.primarySubscriptionPlanId?i?.recommendedSubscriptionPlanId:void 0;return{[pn]:{subscriptionPlan:{selectedOption:n?.subscriptionPlanId,allOptions:to(d,p)},recurringAddOns:hn(l,n?.subscriptionAddOnIds),coupon:{selectedOption:n?.subscriptionCouponIds[0],allOptions:c.map(m=>({label:m.name,value:m.subscriptionCouponId}))}},[Dt]:{changeType:n?.applyEndOfTerm===!0?"applyEndOfTerm":"applyImmediately",shouldProrate:n?.shouldProrate===!0}}},hn=(e,n)=>n?.map(r=>{const i=e.map(a=>({label:a.name,value:a.subscriptionAddOnId,isDisabled:a.subscriptionAddOnId!==r&&n?.includes(a.subscriptionAddOnId)}));return{selectedOption:r,allOptions:i}})??[],oo=e=>{const{subscriptionMetaDetails:n}=e,r=n.plans.filter(d=>d.plan.statusCode==="active").map(d=>d.plan),i=n.addOns.filter(d=>d.addOn.statusCode==="active"&&d.addOn.chargeType==="recurring").map(d=>d.addOn),a=n.coupons.filter(d=>d.coupon.statusCode==="active").map(d=>d.coupon);return{plans:r,addOns:i,coupons:a}},lS=e=>{const{data:n,subscriptionDetail:r}=e;if(n==null||r==null)return!1;const i=r.subscription.subscription.status.code;return[ta(e),!o.isEqual(n.applyEndOfTerm,i!=="future"),!o.isEqual(n.shouldProrate,i==="future"),!o.isEqual(n.invoiceImmediately,!0)].reduce((a,d)=>a||d,!1)},ta=e=>{const{data:n,subscriptionDetail:r}=e;return n==null||r==null?!1:[!o.isEqual(n.subscriptionPlanId,r.plan?.plan.subscriptionPlanId),!o.isEqual(n.subscriptionAddOnIds,r.addOns?.map(i=>i.addOn.subscriptionAddOnId)),!o.isEqual(n.subscriptionCouponIds,r.coupons?.map(i=>i.coupon.subscriptionCouponId))].reduce((i,a)=>i||a,!1)},cS=e=>{const{subscriptionDetail:n}=e,r=n?.subscription.subscription.status.code,i=n?.summary?.summary,a=n?.subscription.subscription.subscriptionPlanId,{plans:d,addOns:l,coupons:c}=oo(e),p=i?.recommendedSubscriptionPlanId!=null&&a===i?.primarySubscriptionPlanId?i?.recommendedSubscriptionPlanId:void 0;return{[pn]:{subscriptionPlan:{selectedOption:a,allOptions:to(d,p)},recurringAddOns:hn(l,n?.addOns.map(m=>m.addOn.subscriptionAddOnId)),coupon:{selectedOption:n?.coupons[0]?.coupon.subscriptionCouponId,allOptions:c.map(m=>({label:m.name,value:m.subscriptionCouponId}))}},[Dt]:{changeType:r==="future"?"applyImmediately":"applyEndOfTerm",shouldProrate:r==="future"}}},zn={labelWidth:new t.ResponsiveSized(115,145,155),mediumLabelWidth:new t.ResponsiveSized(140,160,170),largeLabelWidth:new t.ResponsiveSized(160,210,210),paddingBottom:new t.ResponsiveSized(t.sp[3],t.sp[2])};function dS({sectionId:e,isDisabled:n,subscriptionCreateData:r,subscriptionMetaDetails:i,recommendedSubscriptionPlanId:a,style:d}){const l=t.useWindowSizeContext(),c=t.appLocale.getLocalizedStrings().subscriptionUpdate,{dropDowns:p,dateFormat:{visual:m}}=t.appLocale.getLocalizedStrings(),{labels:x,placeholders:
|
|
2650
|
+
`,Er=e=>`${e}_form`,wr=e=>{const{data:n,subscriptionDetail:r}=e,i=r?.summary?.summary,a=r?.subscription.subscription.subscriptionPlanId,{plans:d,addOns:l,coupons:c}=oo(e),p=i?.recommendedSubscriptionPlanId!=null&&a===i?.primarySubscriptionPlanId?i?.recommendedSubscriptionPlanId:void 0;return{[pn]:{subscriptionPlan:{selectedOption:n?.subscriptionPlanId,allOptions:to(d,p)},recurringAddOns:hn(l,n?.subscriptionAddOnIds),coupon:{selectedOption:n?.subscriptionCouponIds[0],allOptions:c.map(m=>({label:m.name,value:m.subscriptionCouponId}))}},[Dt]:{changeType:n?.applyEndOfTerm===!0?"applyEndOfTerm":"applyImmediately",shouldProrate:n?.shouldProrate===!0}}},hn=(e,n)=>n?.map(r=>{const i=e.map(a=>({label:a.name,value:a.subscriptionAddOnId,isDisabled:a.subscriptionAddOnId!==r&&n?.includes(a.subscriptionAddOnId)}));return{selectedOption:r,allOptions:i}})??[],oo=e=>{const{subscriptionMetaDetails:n}=e,r=n.plans.filter(d=>d.plan.statusCode==="active").map(d=>d.plan),i=n.addOns.filter(d=>d.addOn.statusCode==="active"&&d.addOn.chargeType==="recurring").map(d=>d.addOn),a=n.coupons.filter(d=>d.coupon.statusCode==="active").map(d=>d.coupon);return{plans:r,addOns:i,coupons:a}},lS=e=>{const{data:n,subscriptionDetail:r}=e;if(n==null||r==null)return!1;const i=r.subscription.subscription.status.code;return[ta(e),!o.isEqual(n.applyEndOfTerm,i!=="future"),!o.isEqual(n.shouldProrate,i==="future"),!o.isEqual(n.invoiceImmediately,!0)].reduce((a,d)=>a||d,!1)},ta=e=>{const{data:n,subscriptionDetail:r}=e;return n==null||r==null?!1:[!o.isEqual(n.subscriptionPlanId,r.plan?.plan.subscriptionPlanId),!o.isEqual(n.subscriptionAddOnIds,r.addOns?.map(i=>i.addOn.subscriptionAddOnId)),!o.isEqual(n.subscriptionCouponIds,r.coupons?.map(i=>i.coupon.subscriptionCouponId))].reduce((i,a)=>i||a,!1)},cS=e=>{const{subscriptionDetail:n}=e,r=n?.subscription.subscription.status.code,i=n?.summary?.summary,a=n?.subscription.subscription.subscriptionPlanId,{plans:d,addOns:l,coupons:c}=oo(e),p=i?.recommendedSubscriptionPlanId!=null&&a===i?.primarySubscriptionPlanId?i?.recommendedSubscriptionPlanId:void 0;return{[pn]:{subscriptionPlan:{selectedOption:a,allOptions:to(d,p)},recurringAddOns:hn(l,n?.addOns.map(m=>m.addOn.subscriptionAddOnId)),coupon:{selectedOption:n?.coupons[0]?.coupon.subscriptionCouponId,allOptions:c.map(m=>({label:m.name,value:m.subscriptionCouponId}))}},[Dt]:{changeType:r==="future"?"applyImmediately":"applyEndOfTerm",shouldProrate:r==="future"}}},zn={labelWidth:new t.ResponsiveSized(115,145,155),mediumLabelWidth:new t.ResponsiveSized(140,160,170),largeLabelWidth:new t.ResponsiveSized(160,210,210),paddingBottom:new t.ResponsiveSized(t.sp[3],t.sp[2])};function dS({sectionId:e,isDisabled:n,subscriptionCreateData:r,subscriptionMetaDetails:i,recommendedSubscriptionPlanId:a,style:d}){const l=t.useWindowSizeContext(),c=t.appLocale.getLocalizedStrings().subscriptionUpdate,{dropDowns:p,dateFormat:{visual:m}}=t.appLocale.getLocalizedStrings(),{labels:x,placeholders:g}=c.dropDowns,h=zn.labelWidth.value(l),j=zn.mediumLabelWidth.value(l),b=zn.largeLabelWidth.value(l),{plans:C,addOns:S,coupons:y}=i;return o.jsxRuntimeExports.jsx(pS,{style:d,children:o.jsxRuntimeExports.jsxs(uS,{children:[o.jsxRuntimeExports.jsx(Ji,{label:{label:x.planName,width:j},isDisabled:n,groupedSingleSelectField:{name:Uo(e,"subscriptionPlan"),placeholder:g.selectPlan,valueToInfo:f=>{const E=C.find(R=>R.subscriptionPlanId===f);return t.amountToString("0,0.00",E?.price)},defaultValue:{selectedOption:r?.subscriptionPlanId,allOptions:to(C,a)},registerOptions:{required:!0,validate:f=>f!=null&&f.selectedOption!=null||n!=null}},valueToAdditionalLabel:f=>{const E=C.find(R=>R.subscriptionPlanId===f);return dn(E?.price,E?.period)??""}}),o.jsxRuntimeExports.jsx(Ho,{}),o.jsxRuntimeExports.jsx(ea,{label:{label:x.recurringAddOns,width:h},isDisabled:n,singleSelectPickerField:{name:Uo(e,"recurringAddOns"),placeholder:g.selectAddOn,valueToInfo:f=>{const E=S.find(R=>R.subscriptionAddOnId===f);return t.amountToString("0,0.00",E?.price)}},valueToAdditionalLabel:f=>{const E=S.find(R=>R.subscriptionAddOnId===f);return dn(E?.price,E?.period)??""},defaultValues:r?.subscriptionAddOnIds??[],allOptions:S.map(f=>({label:f.name,value:f.subscriptionAddOnId}))}),o.jsxRuntimeExports.jsx(Ho,{}),o.jsxRuntimeExports.jsx(t.LabeledItemWithButton,{isDisabled:"readonly",label:{label:x.nonRecurringAddOns,width:b},style:{opacity:.32},button:{buttonTitle:p.add,style:{pointerEvents:"none"}}}),o.jsxRuntimeExports.jsx(Ho,{}),o.jsxRuntimeExports.jsx(t.LabeledSingleSelectPickerField,{isDisabled:n,label:{label:x.coupon,width:h},singleSelectPickerField:{name:Uo(e,"coupon"),placeholder:g.selectCoupon,defaultValue:{selectedOption:r?.subscriptionCouponIds[0],allOptions:y.map(f=>({label:f.name,value:f.subscriptionCouponId}))}}}),o.jsxRuntimeExports.jsx(Ho,{}),o.jsxRuntimeExports.jsx(t.LabeledDatePickerField,{isDisabled:n,label:{label:x.startDate,width:h},dateField:{name:Uo(e,"planStartDate"),placeholder:g.selectStartDate,defaultValue:r?.startDate,dateFormat:m.defaultInput,minDate:J.dateNow(),autoComplete:"off"}})]})})}const Uo=(e,n)=>`${e}.${n}`,pS=s.div`
|
|
2651
2651
|
display: flex;
|
|
2652
2652
|
flex-direction: column;
|
|
2653
2653
|
padding-top: ${t.Space.sp3};
|
|
@@ -2684,7 +2684,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2684
2684
|
`,CS=s.div`
|
|
2685
2685
|
display: flex;
|
|
2686
2686
|
flex-direction: column;
|
|
2687
|
-
`,vr="subscriptionAddPlanPage",un="addPlan",mn="invoiceOption";function jS(e){const n=t.useWindowSizeContext(),r=o.useTheme(),i=u.useRef(null),{localData:a,isDisabled:d,onSubscriptionDetailsChanged:l,onEstimateSuccess:c,onReviewClick:p,onBackClick:m,onResetClick:x}=e,[
|
|
2687
|
+
`,vr="subscriptionAddPlanPage",un="addPlan",mn="invoiceOption";function jS(e){const n=t.useWindowSizeContext(),r=o.useTheme(),i=u.useRef(null),{localData:a,isDisabled:d,onSubscriptionDetailsChanged:l,onEstimateSuccess:c,onReviewClick:p,onBackClick:m,onResetClick:x}=e,[g,h]=u.useState(void 0),{data:j,fetchState:b,estimateStatus:C}=a,S=t.usePrevious(C.fetchState),y=t.usePrevious(b),f=o.useForm({mode:"all",reValidateMode:"onChange",defaultValues:u.useMemo(()=>Tr(a),[a])});u.useEffect(()=>()=>{h(void 0)},[]),u.useEffect(()=>{y==="In-Progress"&&b==="Completed"&&f.reset(Tr(a))},[y,b,f,a]),u.useEffect(()=>{S==="In-Progress"&&(C.fetchState==="Error"?g!==C.fetchState&&h(C.fetchState):C.fetchState==="Completed"&&(h(void 0),c()))},[g,S,C.fetchState,c]);const E=async(F,D)=>{(F.includes(un)||F.includes(mn))&&l(D)};u.useEffect(()=>{const F=f.watch((D,{name:K})=>{K!=null&&D!=null&&o.defer(()=>E(K,D))});return()=>{F.unsubscribe()}});const R=f.handleSubmit(F=>{g!=null&&h(void 0),p()}),{addPlan:I,snackBar:A,footer:v}=t.appLocale.getLocalizedStrings().subscriptionUpdate,{title:T}=I;return o.jsxRuntimeExports.jsxs(bS,{children:[o.jsxRuntimeExports.jsx(t.NavBar,{title:T,backgroundColor:r.colors.grey4,style:{zIndex:3},onBackClick:m,scrollableContent:i,source:"SubscriptionAddPlanPage"}),g!=null?o.jsxRuntimeExports.jsx(t.SubscriptionSnackBar,{fetchState:g,customMessageText:C.error?.message??A.failedText,onRemoveSnackbar:()=>h(void 0)}):null,o.jsxRuntimeExports.jsx($S,{ref:i,windowSize:n,children:b==="In-Progress"||b==="Not-Started"?o.jsxRuntimeExports.jsx(RS,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Large",start:!0})}):o.jsxRuntimeExports.jsx(o.FormProvider,{...f,children:o.jsxRuntimeExports.jsxs("form",{id:kr(vr),onSubmit:R,children:[o.jsxRuntimeExports.jsx(dS,{sectionId:un,subscriptionCreateData:j,subscriptionMetaDetails:oo(a),isDisabled:d}),o.jsxRuntimeExports.jsx(xS,{sectionId:mn,style:{paddingBottom:t.Space.sp9},subscriptionCreateData:j,isDisabled:d})]})})}),t.formHasDirtyFields(f.formState.dirtyFields)||ES(a)?o.jsxRuntimeExports.jsx(t.Footer,{formId:kr(vr),primaryBtn:{label:v.review,isLoading:C.fetchState==="In-Progress",isDisabled:e.isDisabled!=null&&C.fetchState!=="In-Progress"},cancelBtn:{label:v.cancel,shouldResetOnCancel:!0,onClick:()=>{f.reset(wS(a)),x()}}}):null]})}const bS=s.div`
|
|
2688
2688
|
display: flex;
|
|
2689
2689
|
min-height: 100%;
|
|
2690
2690
|
flex-direction: column;
|
|
@@ -2754,7 +2754,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2754
2754
|
&:hover {
|
|
2755
2755
|
color: ${e=>e.theme.colors.primary};
|
|
2756
2756
|
}
|
|
2757
|
-
`,NS=t.appLocale.getLocalizedStrings(),{common:{strings:MS},cockpit:{portfolio:{header:{runway:zS}}}}=NS,FS=({companyView:e,companyNameSticky:n,totalHeight:r,addThreadRequestThreadId:i,setNoteData:a,setElementRef:d,setAddThreadRequestThreadId:l,onCompanyNameClicked:c,onPassportIconClicked:p})=>{const m=t.useWindowSizeContext(),{accountingSummary:x,company:
|
|
2757
|
+
`,NS=t.appLocale.getLocalizedStrings(),{common:{strings:MS},cockpit:{portfolio:{header:{runway:zS}}}}=NS,FS=({companyView:e,companyNameSticky:n,totalHeight:r,addThreadRequestThreadId:i,setNoteData:a,setElementRef:d,setAddThreadRequestThreadId:l,onCompanyNameClicked:c,onPassportIconClicked:p})=>{const m=t.useWindowSizeContext(),{accountingSummary:x,company:g}=e,{companyId:h,name:j}=g.company.companyInfo,b=`cockpit_${h}`,C="portfolio.notes",{threads:S,isLoading:y}=t.useFilteredThreads({entityType:C,companyId:h},!1),{openThread:f,threads:E,addThread:R,removeThread:I,setOpenThread:A,setRequestToOpenThread:v}=u.useContext(t.ThreadsContext),T=f!==null?E.get(f):null,F=f?.includes(h)===!0,D=f!=null&&E.get(f)==null&&F,K=i!=null&&E.get(i)?.metadata.companyId===h,M=u.useCallback(()=>{f?.includes(t.NEW_THREAD_SUFFIX)===!0&&I(f),i!=null&&l(void 0)},[i,f,I,l]),Y=k=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:k.isElementThreadOpen??!1,isElementThreadPresent:k.isElementThreadPresent??!1,itemKey:k.itemKey,elementThreadId:k.elementThreadId??"",roomId:b,addThreadRequestThreadId:i,openThreadId:f,threadStyle:k.threadStyle,openThreadMetadata:T?.metadata??null,onElementClick:w,onAddThreadClick:P}),G=u.useCallback(k=>{if(k===f)A(null);else if(E.has(k))A(k);else if(k.includes(t.NEW_THREAD_SUFFIX)){const[O,z]=k.replace(t.NEW_THREAD_SUFFIX,"").split("."),Z=Wt(Rt(O),J.toPortfolioSortKeyType(z),h,j);R(k,{type:"thread",id:k,roomId:b,createdAt:new Date,updatedAt:new Date,comments:[],metadata:Z,resolved:!1}),A(k)}},[h,j,f,b,E,R,A]),w=u.useCallback((k,O,z=!1)=>{const Z=Mt.find(ie=>ie.key===O);if(v(null),Z!=null&&(k.type==="contextmenu"||z===!0)){if(Z.isThreadAllowed===!1)return;M(),k.preventDefault(),k.stopPropagation();const ie=t.toCollaborationEntityType({tab:"portfolio",key:Z.key}),N=[...t.getFilteredThreads(E,{entityType:ie,companyId:h},"both")],H=N.length>0&&N[0].length>0?N[0][0]:Le("portfolio",Z.key,h);E.has(H)?G(H):i===H?l(void 0):(l(H),A(null))}},[E,h,i,G,l,A,v,M]),P=u.useCallback((k,O)=>{k.stopPropagation();const z=Le("portfolio",O,h);l(void 0),G(z)},[h,l,G]),B={name:e.company.company.companyInfo.name,runway:x.runway,cashBalance:x.cashPosition?.balance,expenses:x.cogs?.balance&&x.expenses?.balance?BS(x.cogs?.balance,x.expenses?.balance):void 0,netIncome:x.netBurnOrIncome?.balance,revenues:x.income?.balance};return o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{v(null),i!=null&&(l(void 0),i.includes(t.NEW_THREAD_SUFFIX)&&I(i))},children:o.jsxRuntimeExports.jsx(_S,{windowSize:m,isThreadOpen:F||K,totalHeight:r,isCreationInProgress:D,children:Mt.map((k,O)=>{const z=t.toCollaborationEntityType({tab:"portfolio",key:k.key}),Z=[...t.getFilteredThreads(E,{entityType:z,companyId:h},"both")],ie=Mt.length-2<=O,N=Z.length>0&&Z[0].length>0?Z[0][0]:Le("portfolio",k.key,h),H=E.get(N),L=H!=null&&H.resolved===!1,Q=N===f,se=i===N;switch(k.key){case"companyName":return o.jsxRuntimeExports.jsxs(ZS,{companyNameSticky:n,columnWidth:k.width,windowSize:m,isThreadOpen:Q||se,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:X=>w(X,k.key),ref:X=>{d(h,k.key,X)},children:[o.jsxRuntimeExports.jsxs(WS,{children:[o.jsxRuntimeExports.jsx(VS,{onClick:X=>{X.preventDefault(),c(e)},children:B.name}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:Q,roomId:b,openThreadId:f,openThreadMetadata:T?.metadata??null})]}),o.jsxRuntimeExports.jsxs(HS,{children:[o.jsxRuntimeExports.jsxs(KS,{onClick:X=>{X.preventDefault(),a({roomId:b,companyId:h,companyName:j,entityType:C})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:S.length,isLoading:y}),o.jsxRuntimeExports.jsx(GS,{})]}),o.jsxRuntimeExports.jsx(YS,{onClick:X=>{X.preventDefault(),p(e)},children:o.jsxRuntimeExports.jsx(US,{className:"passportIcon"})})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:L,itemKey:k.key,style:{left:t.Space.sp4},onElementClick:w}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Le("portfolio",k.key,h),addThreadRequestThreadId:i,itemKey:k.key,onAddThreadClick:P})]},N);case"cashBalance":return o.jsxRuntimeExports.jsxs(co,{ref:X=>{d(h,k.key,X)},columnWidth:k.width,windowSize:m,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:X=>w(X,k.key),children:[o.jsxRuntimeExports.jsx(Ko,{textColor:t.getCockpitColor("cashBalance"),wrapperWidth:k.width,windowSize:m,children:t.amountToString("0,0",B.cashBalance)}),Y({isElementThreadOpen:Q,isElementThreadPresent:L,itemKey:k.key,elementThreadId:N,threadStyle:ie?{right:t.Space.sp0}:void 0})]},N);case"expenses":return o.jsxRuntimeExports.jsxs(co,{ref:X=>{d(h,k.key,X)},columnWidth:k.width,windowSize:m,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:X=>w(X,k.key),children:[o.jsxRuntimeExports.jsx(Ko,{textColor:t.getCockpitColor("expenses"),wrapperWidth:k.width,windowSize:m,children:t.amountToString("0,0",B.expenses)}),Y({isElementThreadOpen:Q,isElementThreadPresent:L,itemKey:k.key,elementThreadId:N,threadStyle:ie?{right:t.Space.sp0}:void 0})]},N);case"revenues":return o.jsxRuntimeExports.jsxs(co,{ref:X=>{d(h,k.key,X)},columnWidth:k.width,windowSize:m,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:X=>w(X,k.key),children:[o.jsxRuntimeExports.jsx(Ko,{textColor:t.getCockpitColor("revenues"),wrapperWidth:k.width,windowSize:m,children:t.amountToString("0,0",B.revenues)}),Y({isElementThreadOpen:Q,isElementThreadPresent:L,itemKey:k.key,elementThreadId:N,threadStyle:ie?{right:t.Space.sp0}:void 0})]},N);case"netIncome":return o.jsxRuntimeExports.jsxs(co,{ref:X=>{d(h,k.key,X)},columnWidth:k.width,windowSize:m,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:X=>w(X,k.key),children:[o.jsxRuntimeExports.jsx(Ko,{textColor:t.getCockpitColor("netIncome"),wrapperWidth:k.width,windowSize:m,children:t.amountToString("0,0",B.netIncome)}),Y({isElementThreadOpen:Q,isElementThreadPresent:L,itemKey:k.key,elementThreadId:N,threadStyle:ie?{right:t.Space.sp0}:void 0})]},N);case"runway":return o.jsxRuntimeExports.jsxs(co,{ref:X=>{d(h,k.key,X)},columnWidth:k.width,windowSize:m,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:X=>w(X,k.key),children:[o.jsxRuntimeExports.jsx(XS,{wrapperWidth:k.width,windowSize:m,children:B.runway!=null?o.jsxRuntimeExports.jsx(t.Tooltip,{variant:"runway",data:B.runway,placement:"right",title:zS,children:o.jsxRuntimeExports.jsx(QS,{textColor:t.getCockpitColor(B.runway.runwayStatusCode)})}):o.jsxRuntimeExports.jsx(qS,{children:MS.hyphen})}),Y({isElementThreadOpen:Q,isElementThreadPresent:L,itemKey:k.key,elementThreadId:N,threadStyle:ie?{right:t.Space.sp0}:void 0})]},N);default:return null}})})})},BS=(e,n)=>({amount:e.amount+n.amount,currencyCode:e.currencyCode,currencySymbol:e.currencySymbol}),_S=s.div`
|
|
2758
2758
|
border: 1px solid ${e=>e.theme.colors.grey3};
|
|
2759
2759
|
border-radius: ${t.Space.sp2};
|
|
2760
2760
|
display: flex;
|
|
@@ -2908,7 +2908,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2908
2908
|
color: ${e=>e.textColor.color.toString()};
|
|
2909
2909
|
`,Wn=s(t.StandardRegular)`
|
|
2910
2910
|
color: ${e=>e.theme.colors.champion};
|
|
2911
|
-
`,Yt=s.div``,ny={portfolioRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{common:{headers:{comments:sy}},collaboration:{threads:{placeholder:{addANewComment:ry,replyAComment:iy},tooltip:{resolveComment:ay,unResolveComment:ly}}}}=t.appLocale.getLocalizedStrings(),cy=({portfolioView:e,onColumnSortConfigChanged:n,onCompanyNameClicked:r,onPassportIconClicked:i,onScroll:a,initialOpenThreadRequest:d})=>{const l=t.useWindowSizeContext(),c=u.useRef(null),[p,m]=u.useState(null),[x,
|
|
2911
|
+
`,Yt=s.div``,ny={portfolioRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{common:{headers:{comments:sy}},collaboration:{threads:{placeholder:{addANewComment:ry,replyAComment:iy},tooltip:{resolveComment:ay,unResolveComment:ly}}}}=t.appLocale.getLocalizedStrings(),cy=({portfolioView:e,onColumnSortConfigChanged:n,onCompanyNameClicked:r,onPassportIconClicked:i,onScroll:a,initialOpenThreadRequest:d})=>{const l=t.useWindowSizeContext(),c=u.useRef(null),[p,m]=u.useState(null),[x,g]=u.useState(null),h=!(l==="small"||l==="medium-compact"),{uiState:j,totalCashBalance:b,totalExpenses:C,totalRevenues:S}=e,y=j.scrollYOffset??0,f=M=>e.companies[M].company.company.companyInfo.name.length>_t?Ie+32:Ie;u.useEffect(()=>{c.current&&c.current.resetAfterIndex(0)},[e]);const{setOpenThread:E,setRequestToOpenThread:R,requestToOpenThread:I,isLoading:A}=u.useContext(t.ThreadsContext);u.useEffect(()=>{d!=null&&e.fetchState==="Completed"&&A===!1&&R(d)},[d,e.fetchState,A,R]);const[v,T]=u.useState(void 0),F=u.useRef([]),D=u.useMemo(()=>({makeCompanyNameSticky:h,uiState:j,totalCashBalance:b,totalExpenses:C,totalRevenues:S,onColumnSortConfigChanged:n}),[h,b,C,S,j,n]),K=u.useCallback((M,Y,G)=>{const w=e.companies.findIndex(B=>B.company.company.companyInfo.companyId===M),P=Mt.findIndex(B=>B.key===Y);w!==-1&&P!==-1&&(F.current[w]==null?F.current[w]=[G]:F.current[w][P]=G)},[e.companies]);return u.useEffect(()=>{if(I!=null&&p!=null){const{companyId:M,entityType:Y}=I,[G,w]=Y.split("."),P=e.companies.findIndex(z=>z.company.company.companyInfo.companyId===M),B=Mt.findIndex(z=>z.key===w);P!==-1&&!(p.visibleStartIndex<=P&&p.visibleStopIndex>=P)&&c.current?.scrollToItem(P,"center"),setTimeout(()=>{const z=F.current[P]?.[0]?.getBoundingClientRect().bottom,Z=F.current[P]?.[0]?.getBoundingClientRect().top;z!=null&&Z!=null&&(window.innerHeight>=z&&window.innerHeight>=Z||Z<0)&&F.current[P][B]?.scrollIntoView({block:"center",behavior:"auto"})},0);const O=setInterval(()=>{const z=F.current[P]?.[B]?.getBoundingClientRect().left,Z=F.current[P]?.[B]?.getBoundingClientRect().right,ie=F.current[P]?.[B]?.offsetWidth;if(z!=null&&ie!=null&&Z!=null&&(z<window.innerWidth-ie||Z<window.innerWidth)){clearInterval(O);const N=I.threadId,H=I.onThreadShownCallback;N&&(R(null),E(I.threadId),H?.())}},500);setTimeout(()=>{clearInterval(O),R(null)},2e3)}},[I,p,E,R]),o.jsxRuntimeExports.jsxs(py,{companyNameSticky:h,children:[h&&o.jsxRuntimeExports.jsx(oa,{totalCashBalance:b,totalExpenses:C,totalRevenues:S,companyNameSticky:h}),o.jsxRuntimeExports.jsx(uy,{companyNameSticky:h,children:o.jsxRuntimeExports.jsxs(na.Provider,{value:D,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:M,width:Y})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:M,innerElementType:sa,itemCount:e.companies.length,itemSize:f,onItemsRendered:G=>m(G),itemData:{portfolioView:e,makeCompanyNameSticky:h,addThreadRequestThreadId:v,setElementRef:K,setAddThreadRequestThreadId:T,setNoteData:g,onCompanyNameClicked:r,onPassportIconClicked:i},width:Y,ref:c,overscanCount:Bt,onScroll:({scrollOffset:G})=>{a(G)},initialScrollOffset:y,children:dy})}),x!=null?o.jsxRuntimeExports.jsx(Xe.RoomProvider,{id:x.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${x.companyName} ${sy}`,filter:{application:"cockpit",companyId:x.companyId,entityType:x.entityType,isGlobalComment:!1,tab:"portfolio"},isLoading:!1,threadMetadata:{companyName:x.companyName,companyId:x.companyId,entityId:x.companyId,entityType:x.entityType,isGlobalComment:!1,application:"cockpit",tab:"portfolio",url:window.location.href},textOverrides:{composerPlaceholder:ry,replyComposerPlaceholder:iy,threadResolve:ay,threadUnResolve:ly},onThreadClick:M=>null,onCloseAllThreadsDrawer:()=>g(null)})}):null]})})]})},na=u.createContext(void 0),dy=({index:e,style:n,data:r})=>{const i=t.useWindowSizeContext(),{portfolioView:a,makeCompanyNameSticky:d,addThreadRequestThreadId:l,setElementRef:c,setNoteData:p,onCompanyNameClicked:m,onPassportIconClicked:x,setAddThreadRequestThreadId:g}=r,h=a.companies[e],{companyId:j}=h.company.company.companyInfo;return o.jsxRuntimeExports.jsx(my,{style:{...n,width:"fit-content",minWidth:"100%",padding:`${t.Space.sp0} ${ny.portfolioRightPadding.valuePx(i)} ${t.Space.sp3} ${t.Space.sp0}`},children:o.jsxRuntimeExports.jsx(FS,{addThreadRequestThreadId:l,setNoteData:p,setElementRef:c,setAddThreadRequestThreadId:g,totalHeight:typeof n.height=="number"?n.height:Ie,companyView:a.companies[e],companyNameSticky:d,onCompanyNameClicked:m,onPassportIconClicked:x})},j)},sa=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,totalCashBalance:c,totalExpenses:p,totalRevenues:m,onColumnSortConfigChanged:x}=u.useContext(na);return o.jsxRuntimeExports.jsxs(hy,{ref:n,style:{...i,width:"auto"},...a,children:[!d&&o.jsxRuntimeExports.jsx(oa,{totalCashBalance:c,totalExpenses:p,totalRevenues:m,companyNameSticky:d}),o.jsxRuntimeExports.jsx(TS,{companyNameSticky:d,onColumnSortConfigChanged:x,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder}}),o.jsxRuntimeExports.jsx(xy,{children:r})]})});sa.displayName="Portfolio list view inner element type";const py=s.div`
|
|
2912
2912
|
width: 100%;
|
|
2913
2913
|
height: 100%;
|
|
2914
2914
|
background-color: ${e=>e.theme.colors.grey4};
|
|
@@ -2942,7 +2942,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2942
2942
|
height: calc(100vh - 45px);
|
|
2943
2943
|
overflow-y: hidden;
|
|
2944
2944
|
background-color: ${e=>e.theme.colors.grey4};
|
|
2945
|
-
`,fy=({headerData:e,headerActions:n,portfolioPageActions:r,portfolioPageData:i,initialOpenThreadRequest:a})=>{const{portfolioView:d}=i,{onColumnSortConfigChanged:l,onCompanyNameClicked:c,onPassportIconClicked:p,onScroll:m,onFiltersChange:x,onCockpitReloadData:
|
|
2945
|
+
`,fy=({headerData:e,headerActions:n,portfolioPageActions:r,portfolioPageData:i,initialOpenThreadRequest:a})=>{const{portfolioView:d}=i,{onColumnSortConfigChanged:l,onCompanyNameClicked:c,onPassportIconClicked:p,onScroll:m,onFiltersChange:x,onCockpitReloadData:g}=r,h=d.uiState.filterText,j=d.uiState.filters,b=d.fetchState==="Completed";return n.filterActions&&(n.filterActions.getCategoryWiseOptions=()=>jy()),o.jsxRuntimeExports.jsxs(yy,{children:[o.jsxRuntimeExports.jsx(dt,{headerActions:{...n},headerData:{...e,filterData:{filterText:h,filters:j},companiesLoaded:b,selectedTabOption:"portfolio",allTabOptions:e.allTabOptions??rt}}),o.jsxRuntimeExports.jsx(Cy,{portfolioView:d,onColumnSortConfigChanged:l,onScroll:m,onCockpitReloadData:g,isFilterApplied:j?.categories!=null,onCompanyNameClicked:c,onPassportIconClicked:p,onClearFilter:()=>x("portfolio",{}),initialOpenThreadRequest:a})]})},Cy=({portfolioView:e,isFilterApplied:n,onColumnSortConfigChanged:r,onCompanyNameClicked:i,onPassportIconClicked:a,onCockpitReloadData:d,onScroll:l,onClearFilter:c,initialOpenThreadRequest:p})=>{const m=t.useWindowSizeContext();return e.fetchState==="Error"?o.jsxRuntimeExports.jsx($t,{onCockpitReloadData:d,selectedCockpitOption:"portfolio"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"?o.jsxRuntimeExports.jsx(gy,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})}):e.companies.length===0?n?o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchOnFilters,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine,filtersApplied:!0,onClearFilter:c}):o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextFirstLine,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine}):o.jsxRuntimeExports.jsx(Sy,{windowSize:m,children:o.jsxRuntimeExports.jsx(cy,{portfolioView:e,onColumnSortConfigChanged:r,onScroll:l,onCompanyNameClicked:i,onPassportIconClicked:a,initialOpenThreadRequest:p})})},jy=()=>Si.reduce((n,r)=>{switch(r.value){case"netBurnOrIncome":return{...n,[r.value]:tl};case"cashPosition":return{...n,[r.value]:ol};case"expenses":return{...n,[r.value]:nl};case"income":return{...n,[r.value]:sl};case"runway":return{...n,[r.value]:rl};default:return{...n,[r.value]:[]}}},{}),{dateFormat:by,aiAccountantCustomer:po}=t.appLocale.getLocalizedStrings(),js=({operationType:e,onCancel:n,onConfirm:r,dialogTitle:i,dialogDescription:a})=>{const d=o.useTheme(),[l,c]=u.useState(""),[p,m]=u.useState(""),x=e==="offboard",g=x||l.length>0&&p.length>0,h=e.replaceAll("_"," "),j=J.zeniDate(new Date().toISOString()).format(by.analytics.YYYYDashMMDashDDFormat),b=i??`${po.jobTriggerDialog.title} — ${h}`;return o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{children:b}),descriptionComponent:a!=null?o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:a}):void 0,primaryButtonText:po.jobTriggerDialog.confirm,secondaryButtonText:po.jobTriggerDialog.cancel,useLegacyStyles:!0,isProceedDisabled:!g,action:{onOkClick:()=>{g&&r(e,l,p)},onCancelClick:n,onClickAway:n},shouldClickAway:!0,style:{background:d.colors.overlayColor},children:!x&&o.jsxRuntimeExports.jsxs(Ry,{children:[o.jsxRuntimeExports.jsxs(Lr,{children:[o.jsxRuntimeExports.jsx(Pr,{children:po.jobTriggerDialog.startDate}),o.jsxRuntimeExports.jsx(Ir,{type:"date",value:l,max:p.length>0?p:j,onChange:C=>c(C.target.value)})]}),o.jsxRuntimeExports.jsxs(Lr,{children:[o.jsxRuntimeExports.jsx(Pr,{children:po.jobTriggerDialog.endDate}),o.jsxRuntimeExports.jsx(Ir,{type:"date",value:p,min:l.length>0?l:void 0,max:j,onChange:C=>m(C.target.value)})]})]})})},Ry=s.div`
|
|
2946
2946
|
display: flex;
|
|
2947
2947
|
flex-direction: column;
|
|
2948
2948
|
gap: ${t.Space.sp3};
|
|
@@ -2965,7 +2965,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2965
2965
|
outline: none;
|
|
2966
2966
|
border-color: ${e=>e.theme.colors.primary};
|
|
2967
2967
|
}
|
|
2968
|
-
`,{aiAccountantCustomer:ft}=t.appLocale.getLocalizedStrings(),Se={rowHeightPx:t.sp[8],headerHeightPx:44,jobRowHeightPx:44,jobHeaderHeightPx:36,jobTableMinHeightPx:200,jobOperationMinWidthPx:120,jobStatusColumnWidthPx:90,jobDateColumnWidthPx:120,jobByColumnWidthPx:100,jobSkeletonRowCount:3,skeletonLoaderHeightPx:14,accuracyLabelMinWidthPx:80,accuracyValueMinWidthPx:45,accuracySuccessThresholdPercent:80,accuracyAlertThresholdPercent:60,sortIconSize:t.Space.sp2,menuIconSize:t.Space.sp3,statusBadgeVerticalPadding:"2px",accuracyBarHeight:t.Space.sp2,globalNavBarHeightPx:45,pageHeaderHeightPx:75,menuDropdownMinWidthPx:160,checkboxColumnWidthPx:40},ot={companyName:200,status:120,bookcloseDate:130,latestTraining:130,latestSync:130,accuracy:100,actions:60},$y=[{key:"companyName",label:ft.table.company,sortable:!0,width:ot.companyName,justifyContent:"flex-start",growToFill:!0},{key:"status",label:ft.table.status,sortable:!0,width:ot.status,justifyContent:"flex-start"},{key:"bookcloseDate",label:ft.table.bookClose,sortable:!0,width:ot.bookcloseDate,justifyContent:"flex-start"},{key:"latestTraining",label:ft.table.lastTraining,sortable:!0,width:ot.latestTraining,justifyContent:"flex-start"},{key:"latestSync",label:ft.table.lastSync,sortable:!0,width:ot.latestSync,justifyContent:"flex-start"},{key:"accuracy",label:ft.table.accuracy,sortable:!0,width:ot.accuracy,justifyContent:"flex-end"},{key:"actions",label:"",sortable:!1,width:ot.actions,justifyContent:"center"}],bs={onboard:{labelKey:"onboard",destructive:!1},evaluate:{labelKey:"evaluate",destructive:!1},full_pipeline:{labelKey:"fullPipeline",destructive:!1},retrain:{labelKey:"retrain",destructive:!1},offboard:{labelKey:"offboard",destructive:!0},cancel_onboarding:{labelKey:"cancelOnboarding",destructive:!0}},ra=(e,n)=>{const{jobTriggerDialog:r}=ft;return e==="offboard"?r.singleDescriptionOffboard.replace("__companyName__",n):r.singleDescription.replace("__companyName__",n).replace("__datesInstruction__",r.datesInstruction)},Rs=e=>J.getAllowedOperationsForStatus(e).map(n=>({operationType:n,...bs[n]})),ia=e=>ft.filters.enrollmentStatus[e]??e;function $s(){const{useDynamicConfig:e}=t.useZeniFeatureContext(),{configValue:n}=e(t.DynamicConfigNames.aiAccountantOnboardingConfig),r=t.useGlobalInfoContext().loggedInUser;return n==null||r?.userId==null?!1:Array.isArray(n.user_list_with_write_access)&&n.user_list_with_write_access.includes(r.userId)}const{common:{strings:qt},dateFormat:an,timeFormat:Ro,aiAccountantCustomer:Ve}=t.appLocale.getLocalizedStrings(),Ey=({customer:e,hasMoreJobs:n,jobs:r,jobsFetchStatus:i,onAction:a,onCancelOnboarding:d,onClose:l,onLoadMoreJobs:c})=>{const[p,m]=u.useState(null),x=$s(),
|
|
2968
|
+
`,{aiAccountantCustomer:ft}=t.appLocale.getLocalizedStrings(),Se={rowHeightPx:t.sp[8],headerHeightPx:44,jobRowHeightPx:44,jobHeaderHeightPx:36,jobTableMinHeightPx:200,jobOperationMinWidthPx:120,jobStatusColumnWidthPx:90,jobDateColumnWidthPx:120,jobByColumnWidthPx:100,jobSkeletonRowCount:3,skeletonLoaderHeightPx:14,accuracyLabelMinWidthPx:80,accuracyValueMinWidthPx:45,accuracySuccessThresholdPercent:80,accuracyAlertThresholdPercent:60,sortIconSize:t.Space.sp2,menuIconSize:t.Space.sp3,statusBadgeVerticalPadding:"2px",accuracyBarHeight:t.Space.sp2,globalNavBarHeightPx:45,pageHeaderHeightPx:75,menuDropdownMinWidthPx:160,checkboxColumnWidthPx:40},ot={companyName:200,status:120,bookcloseDate:130,latestTraining:130,latestSync:130,accuracy:100,actions:60},$y=[{key:"companyName",label:ft.table.company,sortable:!0,width:ot.companyName,justifyContent:"flex-start",growToFill:!0},{key:"status",label:ft.table.status,sortable:!0,width:ot.status,justifyContent:"flex-start"},{key:"bookcloseDate",label:ft.table.bookClose,sortable:!0,width:ot.bookcloseDate,justifyContent:"flex-start"},{key:"latestTraining",label:ft.table.lastTraining,sortable:!0,width:ot.latestTraining,justifyContent:"flex-start"},{key:"latestSync",label:ft.table.lastSync,sortable:!0,width:ot.latestSync,justifyContent:"flex-start"},{key:"accuracy",label:ft.table.accuracy,sortable:!0,width:ot.accuracy,justifyContent:"flex-end"},{key:"actions",label:"",sortable:!1,width:ot.actions,justifyContent:"center"}],bs={onboard:{labelKey:"onboard",destructive:!1},evaluate:{labelKey:"evaluate",destructive:!1},full_pipeline:{labelKey:"fullPipeline",destructive:!1},retrain:{labelKey:"retrain",destructive:!1},offboard:{labelKey:"offboard",destructive:!0},cancel_onboarding:{labelKey:"cancelOnboarding",destructive:!0}},ra=(e,n)=>{const{jobTriggerDialog:r}=ft;return e==="offboard"?r.singleDescriptionOffboard.replace("__companyName__",n):r.singleDescription.replace("__companyName__",n).replace("__datesInstruction__",r.datesInstruction)},Rs=e=>J.getAllowedOperationsForStatus(e).map(n=>({operationType:n,...bs[n]})),ia=e=>ft.filters.enrollmentStatus[e]??e;function $s(){const{useDynamicConfig:e}=t.useZeniFeatureContext(),{configValue:n}=e(t.DynamicConfigNames.aiAccountantOnboardingConfig),r=t.useGlobalInfoContext().loggedInUser;return n==null||r?.userId==null?!1:Array.isArray(n.user_list_with_write_access)&&n.user_list_with_write_access.includes(r.userId)}const{common:{strings:qt},dateFormat:an,timeFormat:Ro,aiAccountantCustomer:Ve}=t.appLocale.getLocalizedStrings(),Ey=({customer:e,hasMoreJobs:n,jobs:r,jobsFetchStatus:i,onAction:a,onCancelOnboarding:d,onClose:l,onLoadMoreJobs:c})=>{const[p,m]=u.useState(null),x=$s(),g=e.enrollment?.status??"unknown",h=e.enrollment,j=h?.accuracy??{},b=i.fetchState==="In-Progress",C=E=>{m({operationType:E})},S=(E,R,I)=>{a(e,E,R,I),m(null)},y=E=>E<r.length,f=()=>{n&&!b&&c()};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(Ty,{children:[o.jsxRuntimeExports.jsx(Ly,{children:o.jsxRuntimeExports.jsxs(Py,{children:[o.jsxRuntimeExports.jsx(Iy,{}),o.jsxRuntimeExports.jsxs(Ay,{children:[o.jsxRuntimeExports.jsx(Dy,{children:e.companyName}),o.jsxRuntimeExports.jsx(Oy,{children:e.tenantId})]}),o.jsxRuntimeExports.jsx(Ny,{onClick:l,children:o.jsxRuntimeExports.jsx(My,{})})]})}),o.jsxRuntimeExports.jsxs(zy,{children:[o.jsxRuntimeExports.jsxs(Vn,{children:[o.jsxRuntimeExports.jsx(Go,{children:Ve.drawer.enrollmentDetails}),o.jsxRuntimeExports.jsxs(By,{children:[o.jsxRuntimeExports.jsxs(uo,{children:[o.jsxRuntimeExports.jsx(mo,{children:Ve.drawer.statusLabel}),o.jsxRuntimeExports.jsx(xo,{children:ia(g)})]}),o.jsxRuntimeExports.jsxs(uo,{children:[o.jsxRuntimeExports.jsx(mo,{children:Ve.drawer.onboarded}),o.jsxRuntimeExports.jsx(xo,{title:h?.onboardedAt!=null?h.onboardedAt.format(Ro.hmmADashDDMMMCommaYYYY):void 0,children:h?.onboardedAt!=null?h.onboardedAt.format(an.visual.MMMDCommaYYYYformat):qt.emDash})]}),o.jsxRuntimeExports.jsxs(uo,{children:[o.jsxRuntimeExports.jsx(mo,{children:Ve.drawer.lastTraining}),o.jsxRuntimeExports.jsx(xo,{title:h?.latestTraining!=null?h.latestTraining.format(Ro.hmmADashDDMMMCommaYYYY):void 0,children:h?.latestTraining!=null?h.latestTraining.format(an.visual.MMMDCommaYYYYformat):qt.emDash})]}),o.jsxRuntimeExports.jsxs(uo,{children:[o.jsxRuntimeExports.jsx(mo,{children:Ve.drawer.lastSync}),o.jsxRuntimeExports.jsx(xo,{title:h?.latestTransactionSync!=null?h.latestTransactionSync.local().format(Ro.hmmADashDDMMMCommaYYYY):void 0,children:h?.latestTransactionSync!=null?h.latestTransactionSync.utc(!0).fromNow():qt.emDash})]}),h?.offboardedAt!=null&&o.jsxRuntimeExports.jsxs(uo,{children:[o.jsxRuntimeExports.jsx(mo,{children:Ve.drawer.offboarded}),o.jsxRuntimeExports.jsx(xo,{title:h.offboardedAt.format(Ro.hmmADashDDMMMCommaYYYY),children:h.offboardedAt.format(an.visual.MMMDCommaYYYYformat)})]})]})]}),o.jsxRuntimeExports.jsxs(Vn,{children:[o.jsxRuntimeExports.jsx(Go,{children:Ve.drawer.modelAccuracy}),Object.keys(j).length>0?o.jsxRuntimeExports.jsx(_y,{children:Object.entries(j).map(([E,R])=>{const I=R*100,A=vy(I),v=`${I.toFixed(0)}${qt.percentage}`,T=`${I.toFixed(1)}${qt.percentage}`;return o.jsxRuntimeExports.jsxs(Wy,{children:[o.jsxRuntimeExports.jsx(Vy,{children:ky(E)}),o.jsxRuntimeExports.jsx(Uy,{children:o.jsxRuntimeExports.jsx(Hy,{style:{width:v,backgroundColor:A}})}),o.jsxRuntimeExports.jsx(Ky,{children:T})]},E)})}):o.jsxRuntimeExports.jsx(Ar,{children:Ve.drawer.noAccuracyData})]}),x&&o.jsxRuntimeExports.jsxs(Vn,{children:[o.jsxRuntimeExports.jsx(Go,{children:Ve.drawer.actionsTitle}),o.jsxRuntimeExports.jsx(Gy,{children:Rs(g).map(E=>o.jsxRuntimeExports.jsx(t.Button,{label:Ve.actions[E.labelKey],variant:E.destructive?"destructive":"outline",size:"small",onClick:()=>{E.operationType==="cancel_onboarding"?d(e):C(E.operationType)}},E.operationType))})]}),o.jsxRuntimeExports.jsxs(Fy,{children:[o.jsxRuntimeExports.jsx(Go,{children:Ve.drawer.jobHistory}),r.length===0&&!b?o.jsxRuntimeExports.jsx(Ar,{children:Ve.drawer.noJobsFound}):o.jsxRuntimeExports.jsxs(Yy,{children:[o.jsxRuntimeExports.jsxs(Zy,{children:[o.jsxRuntimeExports.jsx(Xy,{children:o.jsxRuntimeExports.jsx(t.ExtraSmallSemiBold,{children:Ve.drawer.operation})}),o.jsxRuntimeExports.jsx(qy,{children:o.jsxRuntimeExports.jsx(t.ExtraSmallSemiBold,{children:Ve.drawer.status})}),o.jsxRuntimeExports.jsx(Qy,{children:o.jsxRuntimeExports.jsx(t.ExtraSmallSemiBold,{children:Ve.drawer.created})}),o.jsxRuntimeExports.jsx(Jy,{children:o.jsxRuntimeExports.jsx(t.ExtraSmallSemiBold,{children:Ve.drawer.by})})]}),o.jsxRuntimeExports.jsx(ef,{children:o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:E,width:R})=>o.jsxRuntimeExports.jsx(o.InfiniteLoader,{isItemLoaded:y,itemCount:n?r.length+1:r.length,loadMoreItems:f,children:({onItemsRendered:I})=>o.jsxRuntimeExports.jsx(o.FixedSizeList,{height:E,width:R,itemCount:r.length,itemSize:Se.jobRowHeightPx,itemData:r,onItemsRendered:I,innerElementType:wy,overscanCount:Se.jobSkeletonRowCount,children:aa})})})}),b&&o.jsxRuntimeExports.jsx(af,{children:Array.from({length:Se.jobSkeletonRowCount},(E,R)=>o.jsxRuntimeExports.jsxs(lf,{children:[o.jsxRuntimeExports.jsx(Yo,{$flex:!0,children:o.jsxRuntimeExports.jsx(t.ContentLoaderSkeleton,{width:R%2===0?90:70,height:Se.skeletonLoaderHeightPx})}),o.jsxRuntimeExports.jsx(Yo,{children:o.jsxRuntimeExports.jsx(t.ContentLoaderSkeleton,{width:60,height:Se.skeletonLoaderHeightPx})}),o.jsxRuntimeExports.jsx(Yo,{children:o.jsxRuntimeExports.jsx(t.ContentLoaderSkeleton,{width:t.Space.sp11,height:Se.skeletonLoaderHeightPx})}),o.jsxRuntimeExports.jsx(Yo,{children:o.jsxRuntimeExports.jsx(t.ContentLoaderSkeleton,{width:70,height:Se.skeletonLoaderHeightPx})})]},`skeleton-${R}`))})]})]})]})]}),p!=null&&o.jsxRuntimeExports.jsx(js,{operationType:p.operationType,dialogTitle:Ve.actions[bs[p.operationType].labelKey],dialogDescription:ra(p.operationType,e.companyName),onCancel:()=>m(null),onConfirm:S})]})},aa=u.memo(({index:e,style:n,data:r})=>{const i=r[e],a=i.operationType.replaceAll("_"," "),d=i.triggeredBy!=null?`${i.triggeredBy.firstName} ${i.triggeredBy.lastName}`.trim():qt.emDash;return o.jsxRuntimeExports.jsxs(tf,{style:n,children:[o.jsxRuntimeExports.jsx(of,{children:a}),o.jsxRuntimeExports.jsx(nf,{children:i.status}),o.jsxRuntimeExports.jsx(sf,{title:i.createdAt.format(Ro.hmmADashDDMMMCommaYYYY),children:i.createdAt.format(an.visual.MMMDCommaYYYYformat)}),o.jsxRuntimeExports.jsx(rf,{children:d})]})});aa.displayName="JobListItem";const wy=u.forwardRef(({style:e,...n},r)=>o.jsxRuntimeExports.jsx("div",{ref:r,style:{...e,position:"relative"},...n})),vy=e=>e>=Se.accuracySuccessThresholdPercent?t.Colors.success:e>=Se.accuracyAlertThresholdPercent?t.Colors.alert:t.Colors.important,ky=e=>e.split("_").filter(n=>n.length>0).map(n=>n[0].toUpperCase()+n.slice(1).toLowerCase()).join(" "),Ty=s.div`
|
|
2969
2969
|
display: flex;
|
|
2970
2970
|
flex-direction: column;
|
|
2971
2971
|
background-color: ${e=>e.theme.colors.grey4};
|
|
@@ -3205,7 +3205,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
3205
3205
|
100% {
|
|
3206
3206
|
rotate: 720deg;
|
|
3207
3207
|
}
|
|
3208
|
-
`,{common:{strings:ho},dateFormat:Dr,timeFormat:Or,aiAccountantCustomer:ms}=t.appLocale.getLocalizedStrings(),gf=({customers:e,sortKey:n,sortOrder:r,selectedTenantIds:i,onAction:a,onCancelOnboarding:d,onColumnSortConfigChanged:l,onRowClick:c,onToggleAllVisible:p,onToggleTenantSelection:m})=>{const[x,
|
|
3208
|
+
`,{common:{strings:ho},dateFormat:Dr,timeFormat:Or,aiAccountantCustomer:ms}=t.appLocale.getLocalizedStrings(),gf=({customers:e,sortKey:n,sortOrder:r,selectedTenantIds:i,onAction:a,onCancelOnboarding:d,onColumnSortConfigChanged:l,onRowClick:c,onToggleAllVisible:p,onToggleTenantSelection:m})=>{const[x,g]=u.useState(null),h=$s(),j=u.useMemo(()=>new Set(i),[i]),b=i.length>0,C=u.useMemo(()=>e.map(F=>F.tenantId),[e]),S=u.useMemo(()=>C.filter(F=>j.has(F)).length,[C,j]),y=C.length>0&&S===C.length,f=S>0&&!y,E=F=>{l(F,n===F&&r==="ascending"?"descending":"ascending")},R=u.useCallback((F,D)=>{g({customer:F,operationType:D})},[]),I=u.useCallback((F,D,K)=>{x!=null&&a(x.customer,F,D,K),g(null)},[a,x]),A=u.useRef(null),v=u.useMemo(()=>({customerCount:e.length,customers:e,hasWriteAccess:h,isSelectionActive:b,onCancelOnboarding:d,onRequestAction:R,onRowClick:c,onToggleTenantSelection:m,selectedTenantIdSet:j}),[e,h,b,d,R,c,m,j]),T=u.useCallback(({scrollOffset:F})=>{A.current!=null&&(A.current.scrollLeft=F)},[]);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(yf,{children:[o.jsxRuntimeExports.jsxs(ff,{ref:A,children:[h&&o.jsxRuntimeExports.jsx(wf,{children:o.jsxRuntimeExports.jsx(o.Checkbox,{size:"small",checked:y,indeterminate:f,disabled:C.length===0,onChange:()=>p(C)})}),$y.map(F=>{const D=n===F.key,K=r==="ascending"?"asc":"desc";return o.jsxRuntimeExports.jsx(Cf,{$width:F.width,$justifyContent:F.justifyContent,$growToFill:F.growToFill,children:o.jsxRuntimeExports.jsx(jf,{children:F.sortable&&F.key!=="actions"?o.jsxRuntimeExports.jsxs(bf,{type:"button",$active:D,onClick:()=>E(F.key),children:[F.label,o.jsxRuntimeExports.jsx(Rf,{$direction:D?K:"asc",children:o.jsxRuntimeExports.jsx(t.SvgArrowTailTop,{width:Se.sortIconSize,height:Se.sortIconSize})})]}):F.label})},F.key)})]}),e.length===0?o.jsxRuntimeExports.jsx(If,{children:ms.table.noCustomersFound}):o.jsxRuntimeExports.jsx($f,{children:o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:F,width:D})=>o.jsxRuntimeExports.jsx(o.FixedSizeList,{height:F,width:D,itemCount:e.length,itemSize:Se.rowHeightPx,itemData:v,innerElementType:Sf,onScroll:T,overscanCount:5,children:la})})})]}),x!=null&&o.jsxRuntimeExports.jsx(js,{operationType:x.operationType,dialogTitle:ms.actions[bs[x.operationType].labelKey],dialogDescription:ra(x.operationType,x.customer.companyName),onCancel:()=>g(null),onConfirm:I})]})},la=u.memo(({index:e,style:n,data:r})=>{const{customerCount:i,customers:a,hasWriteAccess:d,isSelectionActive:l,onCancelOnboarding:c,onRequestAction:p,onRowClick:m,onToggleTenantSelection:x,selectedTenantIdSet:g}=r,h=a[e],j=g.has(h.tenantId),b=e===i-1,[C,S]=u.useState(!1),y=u.useRef(null),[f,E]=u.useState({top:0,right:0}),R=h.enrollment?.status??"unknown",I=h.averageAccuracy,A=I>0?`${(I*100).toFixed(1)}${ho.percentage}`:ho.emDash;return u.useEffect(()=>{if(C&&y.current!=null){const v=y.current.getBoundingClientRect();E({top:v.bottom,right:window.innerWidth-v.right})}},[C]),u.useEffect(()=>{if(!C)return;const v=()=>S(!1);return document.addEventListener("click",v),window.addEventListener("scroll",v,!0),window.addEventListener("resize",v),()=>{document.removeEventListener("click",v),window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)}},[C]),u.useEffect(()=>{l&&C&&S(!1)},[l,C]),o.jsxRuntimeExports.jsxs(Ef,{style:n,$isSelected:j,onClick:()=>m(h),children:[d&&o.jsxRuntimeExports.jsx(vf,{$hideBorder:b,onClick:v=>v.stopPropagation(),children:o.jsxRuntimeExports.jsx(o.Checkbox,{size:"small",checked:j,onChange:()=>x(h.tenantId)})}),o.jsxRuntimeExports.jsx(kf,{$hideBorder:b,children:o.jsxRuntimeExports.jsxs("div",{children:[o.jsxRuntimeExports.jsx(Af,{children:h.companyName.length>0?h.companyName:h.companyId}),o.jsxRuntimeExports.jsx(Df,{children:h.tenantId})]})}),o.jsxRuntimeExports.jsx(Tf,{$hideBorder:b,children:o.jsxRuntimeExports.jsx(Of,{status:R,children:ia(R)})}),o.jsxRuntimeExports.jsx(Un,{$hideBorder:b,children:h.bookcloseDate!=null?h.bookcloseDate.format(Dr.visual.MMMDCommaYYYYformat):ho.emDash}),o.jsxRuntimeExports.jsx(Un,{$hideBorder:b,title:h.enrollment?.latestTraining!=null?h.enrollment.latestTraining.format(Or.hmmADashDDMMMCommaYYYY):void 0,children:h.enrollment?.latestTraining!=null?h.enrollment.latestTraining.format(Dr.visual.MMMDCommaYYYYformat):ho.emDash}),o.jsxRuntimeExports.jsx(Un,{$hideBorder:b,title:h.enrollment?.latestTransactionSync!=null?h.enrollment.latestTransactionSync.local().format(Or.hmmADashDDMMMCommaYYYY):void 0,children:h.enrollment?.latestTransactionSync!=null?h.enrollment.latestTransactionSync.utc(!0).fromNow():ho.emDash}),o.jsxRuntimeExports.jsx(Lf,{$hideBorder:b,children:A}),o.jsxRuntimeExports.jsx(Pf,{$hideBorder:b,children:d&&!l&&o.jsxRuntimeExports.jsxs(Nf,{onClick:v=>v.stopPropagation(),children:[o.jsxRuntimeExports.jsx(Mf,{ref:y,onClick:()=>S(!C),children:o.jsxRuntimeExports.jsx(t.SvgMore,{width:Se.menuIconSize,height:Se.menuIconSize})}),C&&Lo.createPortal(o.jsxRuntimeExports.jsx(zf,{style:{top:f.top,right:f.right},children:Rs(R).map(v=>o.jsxRuntimeExports.jsx(Ff,{onClick:()=>{S(!1),v.operationType==="cancel_onboarding"?c(h):p(h,v.operationType)},children:ms.actions[v.labelKey]},v.operationType))}),document.body)]})})]})});la.displayName="AiAccountantCustomerListItem";const Sf=u.forwardRef(({style:e,...n},r)=>o.jsxRuntimeExports.jsx("div",{ref:r,style:{...e,position:"relative"},...n})),yf=s.div`
|
|
3209
3209
|
position: relative;
|
|
3210
3210
|
flex: 1;
|
|
3211
3211
|
min-height: 0;
|
|
@@ -3415,7 +3415,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
3415
3415
|
`,Jo=s(t.LargeSemiBold)`
|
|
3416
3416
|
color: ${e=>e.theme.colors.primary};
|
|
3417
3417
|
margin-top: ${t.Space.sp2};
|
|
3418
|
-
`,{aiAccountantCustomer:He}=t.appLocale.getLocalizedStrings(),Gf="evaluate",Yf=[{label:He.filters.enrollmentStatus.active,value:"active"},{label:He.filters.enrollmentStatus.pending,value:"pending"},{label:He.filters.enrollmentStatus.onboarding,value:"onboarding"},{label:He.filters.enrollmentStatus.offboarded,value:"offboarded"},{label:He.filters.enrollmentStatus.failed,value:"failed"}],Zf=()=>({enrollmentStatus:Yf}),Xf=({headerData:e,headerActions:n,aiAccountantPageActions:r,aiAccountantPageData:i})=>{const a=t.useWindowSizeContext(),d=$s(),{aiAccountantView:l}=i,{onAction:c,onBulkAction:p,onCancelOnboarding:m,onClearSelection:x,onCockpitReloadData:
|
|
3418
|
+
`,{aiAccountantCustomer:He}=t.appLocale.getLocalizedStrings(),Gf="evaluate",Yf=[{label:He.filters.enrollmentStatus.active,value:"active"},{label:He.filters.enrollmentStatus.pending,value:"pending"},{label:He.filters.enrollmentStatus.onboarding,value:"onboarding"},{label:He.filters.enrollmentStatus.offboarded,value:"offboarded"},{label:He.filters.enrollmentStatus.failed,value:"failed"}],Zf=()=>({enrollmentStatus:Yf}),Xf=({headerData:e,headerActions:n,aiAccountantPageActions:r,aiAccountantPageData:i})=>{const a=t.useWindowSizeContext(),d=$s(),{aiAccountantView:l}=i,{onAction:c,onBulkAction:p,onCancelOnboarding:m,onClearSelection:x,onCockpitReloadData:g,onColumnSortConfigChanged:h,onCustomerSelected:j,onEvaluateAll:b,onFilterTextChanged:C,onFiltersChange:S,onToggleAllVisible:y,onToggleTenantSelection:f}=r,E=l.fetchState==="Completed",R=l.fetchState==="In-Progress"||l.fetchState==="Not-Started",I=l.fetchState==="Error",A=l.triggerJobStatus.fetchState==="In-Progress",v=l.selectedTenantIds,T=v.length,F=l.unonboardedTenantIds.length,D=T>0,K=u.useMemo(()=>{if(!D)return[];const N=l.selectedCustomersForJobTrigger.map(Q=>Rs(Q.enrollment?.status??"unknown"));if(N.length===0)return[];const[H,...L]=N;return H.filter(Q=>Q.operationType!=="cancel_onboarding"&&L.every(se=>se.some(X=>X.operationType===Q.operationType)))},[D,l.selectedCustomersForJobTrigger]),[M,Y]=u.useState(!1),G=u.useRef(null),[w,P]=u.useState({top:0,right:0});u.useEffect(()=>{if(M&&G.current!=null){const N=G.current.getBoundingClientRect();P({top:N.bottom,right:window.innerWidth-N.right})}},[M]),u.useEffect(()=>{if(!M)return;const N=()=>Y(!1);return document.addEventListener("click",N),window.addEventListener("scroll",N,!0),window.addEventListener("resize",N),()=>{document.removeEventListener("click",N),window.removeEventListener("scroll",N,!0),window.removeEventListener("resize",N)}},[M]);const[B,k]=u.useState(null),O=()=>{F===0||A||k({mode:"evaluateAll",count:F})},z=N=>{Y(!1),k({mode:"bulk",operationType:N.operationType,operationLabel:He.actions[N.labelKey],count:T})},Z=(N,H,L)=>{B!=null&&(B.mode==="evaluateAll"?b(H,L):p(N,H,L),k(null))},ie=D||F===0||A;return o.jsxRuntimeExports.jsxs(qf,{children:[o.jsxRuntimeExports.jsx(dt,{headerActions:{...n,filterActions:{onFilterTextChanged:(N,H)=>{C(H)},getCategoryWiseOptions:Zf,onFiltersChange:S}},headerData:{...e,allTabOptions:e.allTabOptions??rt,companiesLoaded:E,filterData:{filterText:l.uiState.filterText,filters:l.uiState.filters},selectedTabOption:"aiAccountant"}}),o.jsxRuntimeExports.jsx(Qf,{windowSize:a,children:R?o.jsxRuntimeExports.jsx(_f,{}):I?o.jsxRuntimeExports.jsx($t,{onCockpitReloadData:g,selectedCockpitOption:"aiAccountant"}):o.jsxRuntimeExports.jsxs(c0,{children:[o.jsxRuntimeExports.jsxs(Jf,{children:[o.jsxRuntimeExports.jsx(e0,{children:D&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(o0,{children:He.bulkActions.selectedCount.replace("__count__",String(T))}),o.jsxRuntimeExports.jsx(n0,{type:"button",onClick:x,children:He.bulkActions.clear})]})}),o.jsxRuntimeExports.jsxs(t0,{children:[o.jsxRuntimeExports.jsx(df,{isEnabled:!R,spinRefreshIcon:R,onClick:()=>g("aiAccountant")}),d&&!D&&o.jsxRuntimeExports.jsx(t.Button,{label:He.summary.evaluateAll,variant:"primary",size:"small",disabled:ie,onClick:O}),d&&D&&o.jsxRuntimeExports.jsxs(s0,{children:[o.jsxRuntimeExports.jsxs(r0,{ref:G,onClick:N=>N.stopPropagation(),children:[o.jsxRuntimeExports.jsx(t.Button,{label:He.bulkActions.menuLabel,variant:"primary",size:"small",disabled:K.length===0||A,onClick:()=>Y(!M)}),M&&K.length>0&&Lo.createPortal(o.jsxRuntimeExports.jsx(a0,{style:{top:w.top,right:w.right},children:K.map(N=>o.jsxRuntimeExports.jsx(l0,{onClick:()=>z(N),children:He.actions[N.labelKey]},N.operationType))}),document.body)]}),K.length===0&&o.jsxRuntimeExports.jsx(i0,{children:He.bulkActions.disabledInfo})]})]})]}),o.jsxRuntimeExports.jsx(Hf,{averageAccuracy:l.averageAccuracy,customers:l.customers}),o.jsxRuntimeExports.jsx(gf,{customers:l.customers,sortKey:l.uiState.sortKey,sortOrder:l.uiState.sortOrder,selectedTenantIds:v,onColumnSortConfigChanged:h,onRowClick:j,onAction:c,onCancelOnboarding:m,onToggleAllVisible:y,onToggleTenantSelection:f})]})}),B!=null&&o.jsxRuntimeExports.jsx(js,{operationType:B.mode==="evaluateAll"?Gf:B.operationType,dialogTitle:B.mode==="evaluateAll"?He.bulkActions.evaluateAllDialogTitle:B.operationLabel,dialogDescription:B.mode==="evaluateAll"?He.bulkActions.evaluateAllDialogDescription.replace("__count__",String(B.count)):B.operationType==="offboard"?He.bulkActions.bulkDialogDescriptionOffboard.replace("__count__",String(B.count)):He.bulkActions.bulkDialogDescription.replace("__count__",String(B.count)).replace("__action__",B.operationLabel),onCancel:()=>k(null),onConfirm:Z})]})},qf=s.div`
|
|
3419
3419
|
height: calc(100vh - ${Se.globalNavBarHeightPx}px);
|
|
3420
3420
|
overflow-y: hidden;
|
|
3421
3421
|
background-color: ${e=>e.theme.colors.grey4};
|
|
@@ -3758,7 +3758,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
3758
3758
|
margin-left: ${e=>e.setMargin===!0?"20px":t.Space.sp0};
|
|
3759
3759
|
`,H0=s.div`
|
|
3760
3760
|
height: 18px;
|
|
3761
|
-
`,{common:Te,cockpit:Hr}=t.appLocale.getLocalizedStrings(),Kn=({headerItemData:e,onboardingInfo:n,allUsers:r,retryButtonLoading:i,viaCockpit:a=!1,isDisabled:d=!1,headerKey:l,onOnboardingStepClicked:c,onRetry:p})=>{if(n!=null&&kl(e.key,n)===!0){const m=e.key,x=n[m],
|
|
3761
|
+
`,{common:Te,cockpit:Hr}=t.appLocale.getLocalizedStrings(),Kn=({headerItemData:e,onboardingInfo:n,allUsers:r,retryButtonLoading:i,viaCockpit:a=!1,isDisabled:d=!1,headerKey:l,onOnboardingStepClicked:c,onRetry:p})=>{if(n!=null&&kl(e.key,n)===!0){const m=e.key,x=n[m],g=x.userIds!=null?r.find(b=>b.userId===x.userIds[0]):null,h=x.errorDetails!=null?x.errorDetails.summary:m==="qboLinked"?Hr.review.errors.qboLinked:Hr.review.errors.bankAccountLinked,j=`${Te.via} ${Te.cockpit}`;return x.error===!0&&(m==="qboLinked"||m==="bankAccountLinked")?o.jsxRuntimeExports.jsxs(tn,{children:[o.jsxRuntimeExports.jsxs(K0,{children:[o.jsxRuntimeExports.jsx(t.SvgHighImportance,{width:t.sp[3],height:t.sp[3]}),o.jsxRuntimeExports.jsxs(Z0,{children:[o.jsxRuntimeExports.jsx(X0,{children:o.jsxRuntimeExports.jsx(t.Tooltip,{display:"flex",placement:"bottom",title:o.jsxRuntimeExports.jsx(q0,{children:h}),children:o.jsxRuntimeExports.jsx(G0,{children:h})})}),o.jsxRuntimeExports.jsx(Y0,{}),o.jsxRuntimeExports.jsx(t.Button,{variant:"ghost",size:"small",label:Te.retry,loading:i===!0,onClick:p})]})]}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:g!=null,children:o.jsxRuntimeExports.jsx(on,{setMargin:!0,children:`${a===!0?j:Te.strings.empty}${m==="bankAccountLinked"&&t.isZeniAIUser(r,g?.userId)===!0?`${Te.via} ${Te.texts.chargebee}`:`${Te.by} ${g?.firstName??Te.strings.empty} ${g?.lastName??Te.strings.empty}`}`})})]}):x.completed===!0?o.jsxRuntimeExports.jsxs(tn,{children:[o.jsxRuntimeExports.jsx(vo,{complete:!0,onClick:c!=null?()=>{c(e.key)}:void 0}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:g!=null,children:o.jsxRuntimeExports.jsx(on,{setMargin:!1,children:`${a===!0?j:Te.strings.empty}${m==="bankAccountLinked"&&t.isZeniAIUser(r,g?.userId)===!0?`${Te.via} ${Te.texts.chargebee}`:`${Te.by} ${g?.firstName??Te.strings.empty} ${g?.lastName??Te.strings.empty}`}`})}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:g==null,children:o.jsxRuntimeExports.jsx(Gn,{})})]}):x.pendingVerification===!0&&l==="bankAccountLinked"?o.jsxRuntimeExports.jsxs(tn,{children:[o.jsxRuntimeExports.jsx(vo,{complete:!1,pendingVerification:!0,onClick:c!=null?()=>{c(e.key)}:void 0}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:g!=null,children:o.jsxRuntimeExports.jsx(on,{setMargin:!1,children:`${a===!0?j:Te.strings.empty}${m==="bankAccountLinked"&&t.isZeniAIUser(r,g?.userId)===!0?`${Te.via} ${Te.texts.chargebee}`:`${Te.by} ${g?.firstName??Te.strings.empty} ${g?.lastName??Te.strings.empty}`}`})}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:g==null,children:o.jsxRuntimeExports.jsx(Gn,{})})]}):o.jsxRuntimeExports.jsxs(tn,{children:[o.jsxRuntimeExports.jsx(vo,{isDisabled:d,complete:!1,onClick:c!=null?()=>{c(e.key)}:void 0}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:g!=null,children:o.jsxRuntimeExports.jsx(on,{setMargin:!1,children:`${a===!0?j:Te.strings.empty}${m==="bankAccountLinked"&&t.isZeniAIUser(r,g?.userId)===!0?`${Te.via} ${Te.texts.chargebee}`:`${Te.by} ${g?.firstName??Te.strings.empty} ${g?.lastName??Te.strings.empty}`}`})}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:g==null,children:o.jsxRuntimeExports.jsx(Gn,{})})]})}return null},tn=s.div``,K0=s.div`
|
|
3762
3762
|
display: flex;
|
|
3763
3763
|
align-items: center;
|
|
3764
3764
|
column-gap: ${t.Space.sp1};
|
|
@@ -3797,7 +3797,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
3797
3797
|
margin-left: ${e=>e.setMargin===!0?"20px":t.Space.sp0};
|
|
3798
3798
|
`,Gn=s.div`
|
|
3799
3799
|
height: 18px;
|
|
3800
|
-
`,{common:{strings:Q0},cockpit:{onboarding:Yn}}=t.appLocale.getLocalizedStrings(),J0=["bankAccountLinked","qboLinked","identityVerified","businessVerified"],e2=({companyView:e,companyNameSticky:n,allUsers:r,sendInviteFetchState:i,retryBankAccountConnectionFetchState:a,totalHeight:d,addThreadRequestThreadId:l,targetElementFromNavigation:c,resetTargetElementFromNavigation:p,setNoteData:m,setElementRef:x,setAddThreadRequestThreadId:
|
|
3800
|
+
`,{common:{strings:Q0},cockpit:{onboarding:Yn}}=t.appLocale.getLocalizedStrings(),J0=["bankAccountLinked","qboLinked","identityVerified","businessVerified"],e2=({companyView:e,companyNameSticky:n,allUsers:r,sendInviteFetchState:i,retryBankAccountConnectionFetchState:a,totalHeight:d,addThreadRequestThreadId:l,targetElementFromNavigation:c,resetTargetElementFromNavigation:p,setNoteData:m,setElementRef:x,setAddThreadRequestThreadId:g,onOnboardingStepClicked:h,onSendInviteClick:j,redirectToDashboardOnboarding:b,onRetryBankAccountConnection:C})=>{const[S,y]=u.useState(null),f=t.useWindowSizeContext(),E=o.useForm({mode:"all"}),{company:{company:{companyInfo:{companyId:R,name:I,primaryEmailDomain:A},companyOnboardingInfo:{onboardingInfo:v}}},tenant:T}=e,F=t2(e,r),D=`cockpit_${R}`,K="onboarding.notes",{threads:M,isLoading:Y}=t.useFilteredThreads({entityType:K,companyId:R},!1),{openThread:G,threads:w,addThread:P,removeThread:B,setOpenThread:k}=u.useContext(t.ThreadsContext),O=G!==null?w.get(G):null,z=G?.includes(R)===!0,Z=G!=null&&w.get(G)==null&&z,ie=l!=null&&w.get(l)?.metadata.companyId===R,N=u.useCallback(()=>{G?.includes(t.NEW_THREAD_SUFFIX)===!0&&B(G),l!=null&&g(void 0)},[l,G,B,g]),H=$=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:$.isElementThreadOpen??!1,isElementThreadPresent:$.isElementThreadPresent??!1,itemKey:$.itemKey,elementThreadId:$.elementThreadId??Q0.empty,roomId:D,addThreadRequestThreadId:l,openThreadId:G,threadStyle:$.threadStyle,openThreadMetadata:O?.metadata??null,onElementClick:Q,onAddThreadClick:se,targetElement:c??S}),L=u.useCallback($=>{if($===G)k(null);else if(w.has($))k($);else if($.includes(t.NEW_THREAD_SUFFIX)){const[Ce,ae]=$.replace(t.NEW_THREAD_SUFFIX,"").split("."),ce=Wt(Rt(Ce),J.toOnboardingSortKeyType(ae),R,I);P($,{type:"thread",id:$,roomId:D,createdAt:new Date,updatedAt:new Date,comments:[],metadata:ce,resolved:!1}),k($)}},[R,I,G,w,P,k,D]),Q=u.useCallback(($,Ce,ae=!1)=>{const ce=zt.find($e=>$e.key===Ce);if(p(),ce!=null&&($.type==="contextmenu"||ae===!0)){if(ce.isThreadAllowed===!1)return;N(),$.preventDefault(),$.stopPropagation();const $e=t.toCollaborationEntityType({tab:"onboarding",key:ce.key});if($.target instanceof HTMLElement||$.target instanceof SVGElement)if(ae===!0&&$.target instanceof HTMLElement)y($.target.parentElement);else if($.target instanceof HTMLElement){const pe=Ss($.target,oe);y(pe||$.target)}else{const pe=$.target.closest(`.${oe}`);pe instanceof HTMLElement&&y(pe)}const V=[...t.getFilteredThreads(w,{entityType:$e,companyId:R},"both")],_=V.length>0&&V[0].length>0?V[0][0]:Le("onboarding",ce.key,R);w.has(_)?L(_):l===_?g(void 0):(g(_),k(null))}},[w,R,l,L,g,k,p,N]),se=u.useCallback(($,Ce)=>{$.stopPropagation();const ae=Le("onboarding",Ce,R);g(void 0),L(ae)},[R,g,L]),X=($,Ce)=>{},re=u.useCallback(()=>{C(R)},[C,R]);u.useEffect(()=>{const $=E.watch((Ce,{name:ae})=>{ae!=null&&Ce.companyData!=null&&o.defer(()=>X())});return()=>{$.unsubscribe()}});const te=v?.inviteSent,he=v?.accountingConnectionCreationMode,fe=u.useCallback($=>{if(v==null)return!1;switch($){case"bankAccountLinked":case"qboLinked":case"identityVerified":case"businessVerified":return!0;default:return!1}},[v]),be=u.useCallback($=>{if(J0.includes($)&&fe($)){b(A);return}h(R,$)},[b,A,R,h,fe]),{useFeatureGate:W}=t.useZeniFeatureContext(),{isFeatureEnabled:ee}=W(t.FeatureGatesNames.isDebitCardFeatureEnabled),ge=J.isTenantBankingOnly(ee,T),ve=u.useMemo(()=>{const $=v?.inviteAccepted===!0,Ce=v?.groupCreated.completed===!0,ae=v?.customerCreated.completed===!0,ce=v?.accountingConnectionCreationMode==null,$e=v?.accountingConnectionCreationMode==="zeni_user"&&v?.qboLinked.completed!==!0,V=!ge;return $||!Ce||!ae||ce&&V||$e&&V},[v?.accountingConnectionCreationMode,v?.customerCreated.completed,v?.groupCreated.completed,v?.inviteAccepted,v?.qboLinked.completed,ge]),Re=u.useMemo(()=>v?.inviteSent===!0?Yn.resendInvite:Yn.sendInvite,[v?.inviteSent]);return o.jsxRuntimeExports.jsx(o.FormProvider,{...E,children:o.jsxRuntimeExports.jsx("form",{style:{height:"100%"},children:o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{p(),l!=null&&(g(void 0),l.includes(t.NEW_THREAD_SUFFIX)&&B(l))},children:o.jsxRuntimeExports.jsx(n2,{windowSize:f,isThreadOpen:z||ie,totalHeight:d,isCreationInProgress:Z,children:zt.map(($,Ce)=>{const ae=t.toCollaborationEntityType({tab:"onboarding",key:$.key}),ce=zt.length-2<=Ce,$e=[...t.getFilteredThreads(w,{entityType:ae,companyId:R},"both")],V=$e.length>0&&$e[0].length>0?$e[0][0]:Le("onboarding",$.key,R),_=w.get(V),pe=_!=null&&_.resolved===!1,ye=V===G,ke=l===V;switch($.key){case"companyName":return o.jsxRuntimeExports.jsxs(s2,{companyNameSticky:n,columnWidth:$.width,windowSize:f,isThreadOpen:ye||ke,isThreadAllowed:$.isThreadAllowed,className:oe,onContextMenu:ue=>Q(ue,$.key),ref:ue=>{x(R,$.key,ue)},children:[o.jsxRuntimeExports.jsxs(o2,{children:[o.jsxRuntimeExports.jsx(r2,{onClick:ue=>{ue.preventDefault()},children:I||A}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:ye,targetElement:c??S,roomId:D,openThreadId:G,openThreadMetadata:O?.metadata??null})]}),o.jsxRuntimeExports.jsxs(i2,{className:"notesIcon",onClick:ue=>{ue.preventDefault(),m({roomId:D,companyId:R,companyName:I,entityType:K})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:M.length,isLoading:Y}),o.jsxRuntimeExports.jsx(a2,{})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:pe,itemKey:$.key,style:{left:t.Space.sp4},onElementClick:Q}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Le("onboarding",$.key,R),addThreadRequestThreadId:l,itemKey:$.key,onAddThreadClick:se})]},V);case"groupCreated":case"customerCreated":return o.jsxRuntimeExports.jsxs(Xt,{ref:ue=>{x(R,$.key,ue)},columnWidth:$.width,windowSize:f,isThreadAllowed:$.isThreadAllowed,className:oe,onContextMenu:ue=>Q(ue,$.key),children:[o.jsxRuntimeExports.jsx(Kn,{headerItemData:$,onOnboardingStepClicked:be,onboardingInfo:v,allUsers:r}),H({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"bankAccountLinked":return o.jsxRuntimeExports.jsxs(Xt,{ref:ue=>{x(R,$.key,ue)},columnWidth:$.width,windowSize:f,isThreadAllowed:$.isThreadAllowed,className:oe,onContextMenu:ue=>Q(ue,$.key),children:[o.jsxRuntimeExports.jsx(Kn,{headerItemData:$,onOnboardingStepClicked:be,onboardingInfo:v,allUsers:r,isDisabled:te!==!0,onRetry:re,retryButtonLoading:a==="In-Progress",headerKey:$.key}),H({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"qboLinked":return o.jsxRuntimeExports.jsxs(Xt,{ref:ue=>{x(R,$.key,ue)},columnWidth:$.width,windowSize:f,isThreadAllowed:$.isThreadAllowed,className:oe,onContextMenu:ue=>Q(ue,$.key),children:[o.jsxRuntimeExports.jsx(Kn,{headerItemData:$,onOnboardingStepClicked:be,onboardingInfo:v,allUsers:r,isDisabled:he==="customer"&&te!==!0||ge}),H({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"identityVerified":case"businessVerified":return o.jsxRuntimeExports.jsxs(Xt,{ref:ue=>{x(R,$.key,ue)},columnWidth:$.width,windowSize:f,isThreadAllowed:$.isThreadAllowed,className:oe,onContextMenu:ue=>Q(ue,$.key),children:[o.jsxRuntimeExports.jsx(F0,{headerItemData:$,onOnboardingStepClicked:be,onboardingInfo:v,allUsers:r,isDisabled:te!==!0}),H({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"enroller":return o.jsxRuntimeExports.jsxs(Xt,{ref:ue=>{x(R,$.key,ue)},columnWidth:$.width,windowSize:f,isThreadAllowed:$.isThreadAllowed,className:oe,onContextMenu:ue=>Q(ue,$.key),children:[o.jsxRuntimeExports.jsx(t.UserMultiSelectField,{name:"companyData.controller",value:F.controller,placeholderLabel:Yn.onboardingUsersPlaceholder,isReadOnly:!0,pickerStyles:{titleTextStyle:t.textStyles.largeRegular,multiValueLabelTitleStyle:t.textStyles.largeRegular}}),H({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"invite":return o.jsxRuntimeExports.jsxs(Xt,{ref:ue=>{x(R,$.key,ue)},columnWidth:$.width,windowSize:f,isThreadAllowed:$.isThreadAllowed,className:oe,onContextMenu:ue=>Q(ue,$.key),children:[o.jsxRuntimeExports.jsx(t.Button,{disabled:ve,variant:"primary",label:Re,onClick:()=>j(R,v?.inviteSent??!1),size:"small",loading:i==="In-Progress"}),H({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:$.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);default:return null}})})})})})};function t2(e,n){const r=e.company.company.companyOnboardingInfo.onboardingUserIds,i=n.filter(d=>r.findIndex(l=>l===d.userId)>-1),a=[];return r.forEach(d=>{const l=i.filter(c=>c.userId===d)[0];l!=null&&a.push(l)}),{controller:{allUsers:n,selectedUsers:a}}}const o2=s.div``,n2=s.div`
|
|
3801
3801
|
display: flex;
|
|
3802
3802
|
flex-direction: row;
|
|
3803
3803
|
align-items: center;
|
|
@@ -3897,7 +3897,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
3897
3897
|
z-index: auto;
|
|
3898
3898
|
cursor: ${e=>e.isThreadAllowed?"pointer":"initial"};
|
|
3899
3899
|
position: relative;
|
|
3900
|
-
`,l2={onboardingRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{cockpit:{onboarding:c2},common:{headers:{comments:d2}},collaboration:{threads:{placeholder:{addANewComment:p2,replyAComment:u2},tooltip:{resolveComment:m2,unResolveComment:x2}}}}=t.appLocale.getLocalizedStrings(),h2=({onboardingView:e,qboConnectionPoolFlag:n,onSendInviteClick:r,onOnboardingStepClicked:i,onCancelClicked:a,onGoLiveClicked:d,onScroll:l,onUpdateCustomerCreationStatus:c,onColumnSortConfigChanged:p,redirectToDashboardOnboarding:m,onRetryBankAccountConnection:x,onQBOConnectClick:
|
|
3900
|
+
`,l2={onboardingRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{cockpit:{onboarding:c2},common:{headers:{comments:d2}},collaboration:{threads:{placeholder:{addANewComment:p2,replyAComment:u2},tooltip:{resolveComment:m2,unResolveComment:x2}}}}=t.appLocale.getLocalizedStrings(),h2=({onboardingView:e,qboConnectionPoolFlag:n,onSendInviteClick:r,onOnboardingStepClicked:i,onCancelClicked:a,onGoLiveClicked:d,onScroll:l,onUpdateCustomerCreationStatus:c,onColumnSortConfigChanged:p,redirectToDashboardOnboarding:m,onRetryBankAccountConnection:x,onQBOConnectClick:g,initialOpenThreadRequest:h})=>{const j=t.useWindowSizeContext(),b=u.useRef(null),[C,S]=u.useState(null),{setOpenThread:y,setRequestToOpenThread:f,requestToOpenThread:E,isLoading:R}=u.useContext(t.ThreadsContext);u.useEffect(()=>{h!=null&&e.fetchState==="Completed"&&R===!1&&f(h)},[h,e.fetchState,R,f]);const[I,A]=u.useState(void 0),v=u.useRef(null),T=u.useRef([]),[F,D]=u.useState(null),K=!(j==="small"||j==="medium-compact"),{uiState:M}=e,Y=c2.onboardingCompleted.replace("_company-name_",M.selectedCustomerName),[G,w]=u.useState("Not-Started"),[P,B]=u.useState("Not-Started"),{saveFetchState:k,customerCreationStatus:O}=e;u.useEffect(()=>{k.fetchState==="Completed"&&O.stage!=="none"?(B("Not-Started"),w(k.fetchState)):w("Not-Started")},[k.fetchState,O]),u.useEffect(()=>{e.updateStatus.fetchState==="Completed"?(w("Not-Started"),B(e.updateStatus.fetchState)):B("Not-Started")},[e.updateStatus.fetchState]);const z=0,Z=u.useCallback(()=>{const Q=e.onboardingCustomers.filter(se=>se.company.company.companyInfo.companyId===M.selectedCompanyId);if(Q.length>0){const{company:se,onboardingCustomerInfo:X,tenant:re}=Q[0],te={companyEmailDomain:X.companyEmailDomain,companyId:se.company.companyInfo.companyId,isOnboardingCompleted:!0,isOnboardingTenant:!0,tenantId:re.tenantId,userEmailWithPreOnboardSuccess:X.userEmailWithPreOnboardSuccess};d(te)}},[d,e.onboardingCustomers,M.selectedCompanyId]),ie=u.useCallback(Q=>e.onboardingCustomers[Q].company.company.companyInfo.name.length>_t?Ie+32:Ie,[e.onboardingCustomers]);u.useEffect(()=>{b.current&&b.current.resetAfterIndex(0)},[e]);const N=u.useMemo(()=>({makeCompanyNameSticky:K,uiState:M,onColumnSortConfigChanged:p}),[K,M,p]),H=u.useCallback((Q,se,X)=>{const re=e.onboardingCustomers.findIndex(he=>he.company.company.companyInfo.companyId===Q),te=zt.findIndex(he=>he.key===se);re!==-1&&te!==-1&&(T.current[re]==null?T.current[re]=[X]:T.current[re][te]=X)},[e.onboardingCustomers]),L=u.useCallback(()=>{v.current=null,f(null)},[f]);return u.useEffect(()=>{if(E!=null&&C!=null){const{companyId:Q,entityType:se}=E,[X,re]=se.split("."),te=e.onboardingCustomers.findIndex(W=>W.company.company.companyInfo.companyId===Q),he=zt.findIndex(W=>W.key===re);te!==-1&&!(C.visibleStartIndex<=te&&C.visibleStopIndex>=te)&&b.current?.scrollToItem(te,"center"),setTimeout(()=>{const W=T.current[te]?.[0]?.getBoundingClientRect().bottom,ee=T.current[te]?.[0]?.getBoundingClientRect().top;if(W!=null&&ee!=null&&(window.innerHeight>=W&&window.innerHeight>=ee||ee<0)){const ge=T.current[te][he];ge!=null&&(v.current={companyId:Q,target:ge}),T.current[te][he]?.scrollIntoView({block:"center",behavior:"auto"})}},0);const be=setInterval(()=>{const W=T.current[te]?.[he]?.getBoundingClientRect().left,ee=T.current[te]?.[he]?.getBoundingClientRect().right,ge=T.current[te]?.[he]?.offsetWidth;if(v.current?.companyId===Q&&W!=null&&ge!=null&&ee!=null&&(W<window.innerWidth-ge||ee<window.innerWidth)){clearInterval(be);const ve=E.threadId,Re=E.onThreadShownCallback;ve&&(f(null),y(E.threadId),Re?.())}},500);setTimeout(()=>{clearInterval(be),f(null)},2e3)}},[E,C,y,f]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[n?o.jsxRuntimeExports.jsx(d0,{qboConnectionPool:e.qboConnectionPool,isLoading:e.qboConnectionPool.saveQBOConnectionPoolState.fetchState==="In-Progress",onQBOConnectClick:g}):null,o.jsxRuntimeExports.jsxs(S2,{children:[M.showGoLivePopUp===!0?o.jsxRuntimeExports.jsx(j0,{hasAdminRole:!0,onCancelClick:()=>{a()},onGoLiveClick:Z,showGoLivePopup:M.showGoLivePopUp,loading:e.updateStatus.fetchState==="In-Progress"}):null,G==="Completed"?o.jsxRuntimeExports.jsx(_r,{customerCreationType:O,fetchState:G,onRemoveSnackbar:()=>{c(),w("Not-Started")}}):null,P==="Completed"?o.jsxRuntimeExports.jsx(_r,{fetchState:P,customMessageText:Y,onRemoveSnackbar:()=>{B("Not-Started")}}):null,o.jsxRuntimeExports.jsxs(da.Provider,{value:N,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:Q,width:se})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:Q,width:se,itemCount:e.onboardingCustomers.length,itemSize:ie,onItemsRendered:X=>S(X),overscanCount:Bt,itemData:{onboardingView:e,makeCompanyNameSticky:K,addThreadRequestThreadId:I,targetElement:v.current?.target,resetTargetElementFromNavigation:L,setElementRef:H,setAddThreadRequestThreadId:A,setNoteData:D,onOnboardingStepClicked:i,onSendInviteClick:r,redirectToDashboardOnboarding:m,onRetryBankAccountConnection:x},ref:b,innerElementType:pa,onScroll:({scrollOffset:X})=>{l(X)},initialScrollOffset:z,style:{willChange:"auto"},children:g2})}),F!=null?o.jsxRuntimeExports.jsx(Xe.RoomProvider,{id:F.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${F.companyName} ${d2}`,filter:{application:"cockpit",companyId:F.companyId,entityType:F.entityType,isGlobalComment:!1,tab:"onboarding"},isLoading:!1,threadMetadata:{companyName:F.companyName,companyId:F.companyId,entityId:F.companyId,entityType:F.entityType,isGlobalComment:!1,application:"cockpit",tab:"onboarding",url:window.location.href},textOverrides:{composerPlaceholder:p2,replyComposerPlaceholder:u2,threadResolve:m2,threadUnResolve:x2},onThreadClick:Q=>null,onCloseAllThreadsDrawer:()=>D(null)})}):null]})]})]})},da=u.createContext(void 0),pa=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,onColumnSortConfigChanged:c}=u.useContext(da);return o.jsxRuntimeExports.jsxs(C2,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(T0,{companyNameSticky:d,onColumnSortConfigChanged:c,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder}}),o.jsxRuntimeExports.jsx(f2,{children:r})]})});pa.displayName="Onboarding list view inner element type";const g2=({index:e,style:n,data:r})=>{const i=t.useWindowSizeContext(),{onboardingView:a,makeCompanyNameSticky:d,addThreadRequestThreadId:l,targetElement:c,resetTargetElementFromNavigation:p,setElementRef:m,setNoteData:x,setAddThreadRequestThreadId:g,onOnboardingStepClicked:h,onSendInviteClick:j,redirectToDashboardOnboarding:b,onRetryBankAccountConnection:C}=r,S=a.onboardingCustomers[e],{companyId:y}=S.company.company.companyInfo;return o.jsxRuntimeExports.jsx(y2,{isCollapsed:!0,style:{...n,width:"fit-content",minWidth:"100%",padding:`${t.Space.sp0} ${l2.onboardingRightPadding.valuePx(i)} ${t.Space.sp3} ${t.Space.sp0}`},children:o.jsxRuntimeExports.jsx(e2,{totalHeight:typeof n.height=="number"?n.height:Ie,companyView:a.onboardingCustomers[e],companyNameSticky:d,allUsers:a.zeniUsers.values,sendInviteFetchState:a.sendInviteFetchStateByCompanyId[a.onboardingCustomers[e].company.company.companyInfo.companyId]?.fetchState,addThreadRequestThreadId:l,targetElementFromNavigation:c,resetTargetElementFromNavigation:p,setNoteData:x,setElementRef:m,setAddThreadRequestThreadId:g,retryBankAccountConnectionFetchState:a.retryBankAccountConnectionFetchStateByCompanyId[a.onboardingCustomers[e].company.company.companyInfo.companyId]?.fetchState,onOnboardingStepClicked:h,onSendInviteClick:j,redirectToDashboardOnboarding:b,onRetryBankAccountConnection:C})},y)},S2=s.div`
|
|
3901
3901
|
/** Subtract top so list can occupy remaining available height */
|
|
3902
3902
|
height: calc(100vh - 108px);
|
|
3903
3903
|
max-width: 99.9%;
|
|
@@ -3928,7 +3928,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
3928
3928
|
height: calc(100vh - 45px);
|
|
3929
3929
|
overflow-y: hidden;
|
|
3930
3930
|
background-color: ${e=>e.theme.colors.grey4};
|
|
3931
|
-
`,{cockpit:{emptySearchTextFirstLine:$2,emptySearchTextSecondLine:E2,onboarding:Kr},common:{no:w2,yes:v2}}=t.appLocale.getLocalizedStrings(),k2=({headerData:e,headerActions:n,initialOpenThreadRequest:r,onboardingPageActions:i,onboardingPageData:a})=>{const[d,l]=u.useState(!1),[c,p]=u.useState(void 0),{onboardingView:m,qboConnectionPoolFlag:x}=a,{onScroll:
|
|
3931
|
+
`,{cockpit:{emptySearchTextFirstLine:$2,emptySearchTextSecondLine:E2,onboarding:Kr},common:{no:w2,yes:v2}}=t.appLocale.getLocalizedStrings(),k2=({headerData:e,headerActions:n,initialOpenThreadRequest:r,onboardingPageActions:i,onboardingPageData:a})=>{const[d,l]=u.useState(!1),[c,p]=u.useState(void 0),{onboardingView:m,qboConnectionPoolFlag:x}=a,{onScroll:g,onOnboardingStepClicked:h,onCancelClicked:j,onGoLiveClicked:b,onUpdateCustomerCreationStatus:C,onCockpitReloadData:S,onSendInviteClick:y,onColumnSortConfigChanged:f,redirectToDashboardOnboarding:E,onRetryBankAccountConnection:R,onQBOConnectClick:I}=i,A=m.fetchState==="Completed"&&m.zeniUsers.fetchState==="Completed",v={onOkClick:()=>{l(!1),c!=null&&y(c)},onCancelClick:()=>{l(!1)}};return o.jsxRuntimeExports.jsxs(R2,{children:[d===!0?o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{style:{paddingLeft:t.Space.sp6,paddingRight:t.Space.sp6},children:Kr.confirmationPopup.title}),descriptionComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:Kr.confirmationPopup.subTitle}),primaryButtonText:v2,secondaryButtonText:w2,action:v,style:{background:t.Colors.overlayDark}}):null,o.jsxRuntimeExports.jsx(dt,{headerActions:{...n},headerData:{...e,allTabOptions:e.allTabOptions??rt,companiesLoaded:A,filterData:{filterText:m.uiState.filterText,disableFilters:!0},selectedTabOption:"onboarding"}}),o.jsxRuntimeExports.jsx(T2,{initialOpenThreadRequest:r,onColumnSortConfigChanged:f,onCockpitReloadData:S,onGoLiveClicked:b,onQBOConnectClick:I,onRetryBankAccountConnection:R,onScroll:g,onSendInviteClick:(T,F)=>{F?y(T):(p(T),l(!0))},onboardingView:m,onOnboardingStepClicked:h,onCancelClicked:j,onUpdateCustomerCreationStatus:C,qboConnectionPoolFlag:x,redirectToDashboardOnboarding:E})]})},T2=({onboardingView:e,qboConnectionPoolFlag:n,initialOpenThreadRequest:r,onSendInviteClick:i,onScroll:a,onOnboardingStepClicked:d,onCancelClicked:l,onGoLiveClicked:c,onUpdateCustomerCreationStatus:p,onCockpitReloadData:m,onColumnSortConfigChanged:x,redirectToDashboardOnboarding:g,onRetryBankAccountConnection:h,onQBOConnectClick:j})=>{const b=t.useWindowSizeContext();return e.fetchState==="Error"?o.jsxRuntimeExports.jsx($t,{onCockpitReloadData:m,selectedCockpitOption:"onboarding"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"?o.jsxRuntimeExports.jsx(j2,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})}):e.onboardingCustomers.length===0?o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:$2,emptySearchTextSecondLine:E2}):o.jsxRuntimeExports.jsx(b2,{windowSize:b,children:o.jsxRuntimeExports.jsx(h2,{initialOpenThreadRequest:r,onCancelClicked:l,onColumnSortConfigChanged:x,onGoLiveClicked:c,onQBOConnectClick:j,onRetryBankAccountConnection:h,onScroll:a,onSendInviteClick:i,onUpdateCustomerCreationStatus:p,onboardingView:e,qboConnectionPoolFlag:n,redirectToDashboardOnboarding:g,onOnboardingStepClicked:d})})},L2=({localData:e,labelWidth:n,onCompanyDomainBlurred:r,isOnboardingAllowedForUser:i})=>{const a=t.appLocale.getLocalizedStrings().cockpit.onboarding,{isCustomerCreated:d,isEmailGroupCreated:l,companyEmailDomain:c,companyId:p}=e.newOnboardingCustomerLocalData,m=d===!0||l===!0||p!=null||i===!1,x=c!=null&&D2(c);return o.jsxRuntimeExports.jsxs(P2,{children:[o.jsxRuntimeExports.jsx(A2,{children:a.customer.companyCredentials}),o.jsxRuntimeExports.jsx(I2,{children:o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:a.customer.companyDomain,width:n},text:{type:"text",name:"companySection.companyDomain",placeholder:`${a.customer.add} ${a.customer.domain}`,options:{required:!0,pattern:t.DOMAIN_PATTERN}},onBlur:()=>{x&&r(c)},isDisabled:m===!0?"readonly":void 0})})]})},P2=s.div`
|
|
3932
3932
|
display: flex;
|
|
3933
3933
|
flex-direction: column;
|
|
3934
3934
|
gap: ${t.Space.sp2};
|
|
@@ -3940,7 +3940,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
3940
3940
|
border-top: 1px solid ${e=>e.theme.colors.grey2};
|
|
3941
3941
|
`,A2=s(t.LargeSemiBold)`
|
|
3942
3942
|
color: ${e=>e.theme.colors.champion};
|
|
3943
|
-
`,D2=e=>t.DOMAIN_PATTERN.test(e),{common:{strings:{empty:O2}}}=t.appLocale.getLocalizedStrings(),N2=({name:e,registerOptions:n,defaultValue:r,isDisabled:i,customStyleConfig:a,placeholder:d,valueToInfo:l})=>{const{control:c,formState:{errors:p}}=o.useFormContext(),m=o.useTheme(),x=o.has(p,e),
|
|
3943
|
+
`,D2=e=>t.DOMAIN_PATTERN.test(e),{common:{strings:{empty:O2}}}=t.appLocale.getLocalizedStrings(),N2=({name:e,registerOptions:n,defaultValue:r,isDisabled:i,customStyleConfig:a,placeholder:d,valueToInfo:l})=>{const{control:c,formState:{errors:p}}=o.useFormContext(),m=o.useTheme(),x=o.has(p,e),g={...a,container:(S,y)=>({...S,width:"100%",maxWidth:"100%",minWidth:0,...a?.container?.(S,y)}),valueContainer:(S,y)=>({...S,...a?.valueContainer?.(S,y),boxSizing:"border-box",minHeight:t.Space.sp5,padding:`${t.Space.sp0} ${t.Space.sp2} ${t.Space.sp0} ${t.Space.sp3}`,alignItems:"center",borderRadius:t.BORDER_RADIUS_SELECT_FIELD,justifyContent:y.selectProps.menuIsOpen===!1?"flex-end":"flex-start",outline:"none"}),input:(S,y)=>({...S,...a?.input?.(S,y),outline:"none",...x===!0&&{"& input::placeholder":{color:t.Colors.important}}}),control:(S,y)=>({...S,...a?.control?.(S,y),width:"100%",minHeight:t.Space.sp5,borderRadius:t.BORDER_RADIUS_SELECT_FIELD,outline:"none"}),menu:(S,y)=>({...S,...a?.menu?.(S,y),backgroundColor:m.colors[t.MENU_BG_COLOR],borderRadius:t.BORDER_RADIUS_SELECT_FIELD,border:`1px solid ${m.colors[t.INPUT_BORDER_COLOR_SELECT_FIELD]}`,whiteSpace:"nowrap",zIndex:2,width:"100%",padding:`${t.Space.sp1} ${t.Space.sp0}`,marginTop:y.placement==="top"?t.Space.sp0:t.Space.sp1,marginBottom:y.placement==="top"?t.Space.sp1:t.Space.sp0,boxShadow:"none"}),menuList:(S,y)=>({...S,...a?.menuList?.(S,y),padding:`${t.Space.sp0}`,boxShadow:"none"}),option:(S,y)=>({...S,...a?.option?.(S,y),padding:t.Space.sp0,margin:t.Space.sp0,minHeight:t.Space.sp5,outline:"none",boxShadow:"none",WebkitTapHighlightColor:"transparent",cursor:y.isDisabled===!0?"not-allowed":"pointer",backgroundColor:y.isSelected===!0||y.isFocused===!0?m.colors[t.OPTION_HOVER_FOCUS_BG_COLOR]:m.colors[t.OPTION_BG_COLOR],color:"inherit",":active":{backgroundColor:y.isDisabled===!0?m.colors[t.OPTION_DISABLED_BG_COLOR]:m.colors[t.OPTION_HOVER_FOCUS_BG_COLOR]}})},h=u.useCallback(S=>({value:S.value,label:S.label,isDisabled:S.isDisabled,isFiltered:S.isFiltered,info:l?.(S.value)??O2}),[l]),j=S=>S.filter(y=>y.isFiltered!==!0).map(y=>h(y)),b=S=>{if(S==null||!S)return;const{selectedOptions:y,allOptions:f}=S,E=[];return y.forEach(R=>{const I=f.find(A=>A.value===R);I!=null&&E.push(h(I))}),E},C={isError:x,fieldName:e};return o.jsxRuntimeExports.jsx(o.Controller,{name:e,control:c,defaultValue:r,rules:n,render:({field:{onChange:S,onBlur:y,value:f,ref:E}})=>{const R=f;return o.jsxRuntimeExports.jsx(o.StateManagedSelect$1,{...C,ref:E,isMulti:!0,isSearchable:!0,isClearable:!0,controlShouldRenderValue:!0,placeholder:d,value:b(R),options:j(R.allOptions),backspaceRemovesValue:!1,onChange:I=>{S({selectedOptions:I.map(A=>A.value),allOptions:R.allOptions})},tabSelectsValue:!1,openMenuOnFocus:!0,classNamePrefix:"multi-select-field-with-checkbox",onBlur:y,menuPlacement:"auto",maxMenuHeight:288,menuShouldScrollIntoView:!0,closeMenuOnSelect:!1,components:{Control:M2,Option:V2,Input:F2,MultiValue:B2,MultiValueLabel:_2,MultiValueRemove:eC,ValueContainer:z2,DropdownIndicator:Q2,IndicatorSeparator:J2,Placeholder:W2,ClearIndicator:tC},hideSelectedOptions:!1,styles:g,isDisabled:i!=null})}})},M2=e=>{const{menuIsOpen:n,isFocused:r,isDisabled:i,selectProps:a}=e,{value:d,isError:l}=a;return o.jsxRuntimeExports.jsx(U2,{menuIsOpen:n,isFocused:r,isDisabled:i,optionsLen:d.length,isError:l,children:o.jsxRuntimeExports.jsx(o.components.Control,{...e,className:"select-control",children:e.children})})},z2=e=>{const{selectProps:n}=e,{value:r}=n;return o.jsxRuntimeExports.jsxs(o.components.ValueContainer,{...e,className:"select-value-container",children:[e.children,o.jsxRuntimeExports.jsx(H2,{className:"selected-options",children:r.map(i=>i.isFiltered===!0?null:o.jsxRuntimeExports.jsx(K2,{children:o.jsxRuntimeExports.jsx(G2,{children:i.label})},i.value))})]})},F2=e=>{const{selectProps:n}=e,{placeholder:r,value:i}=n;return o.jsxRuntimeExports.jsx(o.components.Input,{...e,autoComplete:"new-password",placeholder:i.length===0?r:void 0,children:e.children})},B2=e=>{const{data:n}=e;return n.isFiltered===!0?null:o.jsxRuntimeExports.jsx(o.components.MultiValue,{...e,children:e.children})},_2=e=>{const{data:n}=e;return o.jsxRuntimeExports.jsx(o.components.MultiValueLabel,{...e,children:n.label})},W2=()=>null,V2=e=>{const{data:n,isSelected:r,isFocused:i,selectProps:a}=e,{fieldName:d}=a,{isDisabled:l,value:c,label:p}=n;return o.jsxRuntimeExports.jsx(Y2,{className:"select-option-wrapper",isFocused:i,isSelected:r,isDisabled:l,isOptionRecommended:!1,showBottomBorder:!0,children:o.jsxRuntimeExports.jsx(o.components.Option,{...e,className:"select-option",children:o.jsxRuntimeExports.jsx(Z2,{children:o.jsxRuntimeExports.jsxs(q2,{children:[o.jsxRuntimeExports.jsx(t.StyledCheckBox,{name:`${d}.${c}`,checkBoxValue:c,value:r,isDisabled:l===!0?"disabled":void 0,onChange:()=>null}),o.jsxRuntimeExports.jsx(X2,{isSelected:r,isDisabled:l,children:p})]})})})})},U2=s.span`
|
|
3944
3944
|
display: block;
|
|
3945
3945
|
width: 100%;
|
|
3946
3946
|
max-width: 100%;
|
|
@@ -4239,7 +4239,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
4239
4239
|
height: ${t.Space.sp6};
|
|
4240
4240
|
align-items: center;
|
|
4241
4241
|
padding: ${t.Space.sp0} ${t.Space.sp4};
|
|
4242
|
-
`,{cockpit:{onboarding:xe},common:{strings:{colon:xt,empty:Gr},placeholder:xC,labels:hC}}=t.appLocale.getLocalizedStrings(),gC=`${xe.customer.add} ${xe.customer.customerFirstName.toLowerCase()}`,SC=`${xe.customer.add} ${xe.customer.customerLastName.toLowerCase()}`,yC=`${xe.customer.add} ${xe.customer.customerName.toLowerCase()}`,ma=u.forwardRef(({sectionId:e,localData:n,onboardedCompanies:r,isSubsidiary:i,labelWidth:a,realmIdAdditionalLabel:d,productsAdditionalLabel:l,isDisabled:c,largeLabelWidth:p},m)=>{const{emailGroupFetchState:x,newOnboardingCustomerLocalData:
|
|
4242
|
+
`,{cockpit:{onboarding:xe},common:{strings:{colon:xt,empty:Gr},placeholder:xC,labels:hC}}=t.appLocale.getLocalizedStrings(),gC=`${xe.customer.add} ${xe.customer.customerFirstName.toLowerCase()}`,SC=`${xe.customer.add} ${xe.customer.customerLastName.toLowerCase()}`,yC=`${xe.customer.add} ${xe.customer.customerName.toLowerCase()}`,ma=u.forwardRef(({sectionId:e,localData:n,onboardedCompanies:r,isSubsidiary:i,labelWidth:a,realmIdAdditionalLabel:d,productsAdditionalLabel:l,isDisabled:c,largeLabelWidth:p},m)=>{const{emailGroupFetchState:x,newOnboardingCustomerLocalData:g,companyView:h,allProductsList:j}=n,b=o.useTheme(),[C,S]=u.useState(xn(j,g.selectedProducts??[]));u.useEffect(()=>{g.selectedProducts!=null&&S(xn(j,g.selectedProducts))},[g.selectedProducts]);const y=x.fetchState!=="Completed"&&g.isEmailGroupCreated==null,f=c!=null||y?"disabled":c,E=n.companyView?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed===!0;let R;const I=r.find(A=>A.companyInfo.companyId===g.parentCompanyId);return I!=null&&(R={label:I.companyInfo.name,value:I.companyInfo.companyId}),o.jsxRuntimeExports.jsxs(fC,{isDisabled:y,ref:m,children:[o.jsxRuntimeExports.jsxs(CC,{children:[o.jsxRuntimeExports.jsx(bC,{children:xe.customer.customerCreation}),g.companyId!=null&&o.jsxRuntimeExports.jsx(ua,{isCompleted:h?.company.companyOnboardingInfo.onboardingInfo?.customerCreated.completed===!0})]}),o.jsxRuntimeExports.jsxs(jC,{children:[o.jsxRuntimeExports.jsx(t.LabeledNameField,{label:{label:`${xe.customer.customerName}${xt}`,width:a},nameField:{name:`${e}.customerName`,registerOptions:{required:!0},defaultValue:{firstName:n.newOnboardingCustomerLocalData.customerName?.firstName??Gr,lastName:n.newOnboardingCustomerLocalData.customerName?.lastName??Gr},placeHolder:{firstName:gC,lastName:SC,name:yC},showFullNameError:!0},isDisabled:f==="disabled"?"disabled":c,showAdditionalInfoLabel:!0,additionalInfoLabel:xe.customer.customerNameInfoText,style:{width:"auto"}}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${xe.customer.customerEmail}${xt}`,width:a},text:{type:"email",name:`${e}.email`,placeholder:`${xe.customer.add} ${xe.customer.customerEmail.toLowerCase()}`,autoComplete:"off",options:{required:!0}},isDisabled:f==="disabled"?"disabled":c,showAdditionalInfoLabel:!0,additionalInfoLabel:xe.customer.customerEmailInfoText}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${xe.customer.companyName}${xt}`,width:a},text:{type:"text",name:`${e}.name`,placeholder:`${xe.customer.add} ${xe.customer.companyName.toLowerCase()}`,options:{required:!0}},isDisabled:f,showAdditionalInfoLabel:!0,additionalInfoLabel:xe.customer.companyNameInfoText}),i===!0?o.jsxRuntimeExports.jsx(pC,{label:{label:`${xe.customer.entity}${xt}`,width:a},concatText:xe.customer.of,firstSingleSelectField:{name:`${e}.entityType`,placeholder:`${xe.customer.add} ${xe.customer.entity.toLowerCase()}`,defaultValue:{selectedOption:{value:xe.customer.subsidiary,label:xe.customer.subsidiary},allOptions:[{value:xe.customer.parent,label:xe.customer.parent},{value:xe.customer.subsidiary,label:xe.customer.subsidiary}]},style:{backgroundColor:b.colors.background}},secondSingleSelectField:{name:`${e}.company`,placeholder:`${xe.customer.add} ${xe.customer.parent.toLowerCase()}`,defaultValue:{selectedOption:R,allOptions:r.map(A=>({label:A.companyInfo.name,value:A.companyInfo.companyId}))},style:{backgroundColor:b.colors.background},registerOptions:{required:i}},isDisabled:f}):o.jsxRuntimeExports.jsx(t.LabeledSingleSelectWithoutClearableField,{label:{label:`${xe.customer.entity}${xt}`,width:a},singleSelectWithoutClearableField:{name:`${e}.entityType`,placeholder:`${xe.customer.add} ${xe.customer.entity.toLowerCase()}`,defaultValue:{selectedOption:{value:xe.customer.parent,label:xe.customer.parent},allOptions:[{value:xe.customer.parent,label:xe.customer.parent},{value:xe.customer.subsidiary,label:xe.customer.subsidiary}]}},isDisabled:f}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${xe.customer.realmId}${xt}`,width:a},text:{type:"text",name:`${e}.realmId`,placeholder:`${xe.customer.add} ${xe.customer.realmIdText}`,options:{pattern:t.REALM_ID}},showTooltip:!0,tooltipTitle:o.jsxRuntimeExports.jsx(RC,{}),isDisabled:f==="disabled"||E===!0?"disabled":c,isOptional:!0}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${xe.customer.confirmRealmId}${xt}`,width:p},text:{type:"text",name:`${e}.confirmRealmId`,placeholder:`${xe.customer.confirmRealmIdText}`,options:{pattern:t.REALM_ID,validate:(A,v)=>A===v[e].realmId}},additionalInfoLabel:d,disableCopyPaste:!0,isDisabled:f==="disabled"||E===!0?"disabled":c,isOptional:!0}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${xe.customer.hubSpotId}${xt}`,width:a},text:{type:"text",name:"customerSection.hubSpotId",placeholder:`${xe.customer.add} ${xe.customer.hubSpotIdText}`,options:{pattern:t.DIGITS_PATTERN}},isDisabled:f,isOptional:!0}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${xe.customer.chargebeeId}${xt}`,width:a},text:{type:"text",name:"customerSection.chargebeeId",placeholder:`${xe.customer.add} ${xe.customer.chargebeeIdText}`,options:{pattern:t.ALPHA_NUMERIC_PATTERN,required:!0}},isDisabled:f}),o.jsxRuntimeExports.jsx(nC,{label:{label:hC.products,width:a},additionalInfoLabel:l||void 0,multiSelectWithCheckBoxField:{name:"customerSection.products",defaultValue:{allOptions:C,selectedOptions:g.selectedProducts??[]},placeholder:xC.productsPlaceholder,isDisabled:f,registerOptions:{validate:A=>A!=null&&A.selectedOptions.length>0}},style:{width:"auto"}})]})]})});ma.displayName="CustomerCreation";const fC=s.div`
|
|
4243
4243
|
opacity: ${e=>e.isDisabled?.4:1};
|
|
4244
4244
|
display: flex;
|
|
4245
4245
|
flex-direction: column;
|
|
@@ -4255,7 +4255,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
4255
4255
|
border-radius: ${t.Space.sp2};
|
|
4256
4256
|
`,bC=s(t.LargeSemiBold)`
|
|
4257
4257
|
color: ${e=>e.theme.colors.champion};
|
|
4258
|
-
`,RC=()=>{const e=t.appLocale.getLocalizedStrings().cockpit.onboarding.customer.reamlIdTooltip;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Yr,{children:e.firstLine}),o.jsxRuntimeExports.jsx(Yr,{children:e.secondLine})]})},Yr=s.div``,xn=(e,n)=>{const r=n.includes("bookkeeping"),i=n.includes("zeni_checking"),a=n.includes("zeni_cards"),d=n.includes("zeni_treasury"),l=n.includes("zeni_payroll"),c=n.includes("zeni_cfo"),p=n.includes("zeni_tax"),m=l||c||p,x=["zeni_payroll","zeni_cfo","zeni_tax"],
|
|
4258
|
+
`,RC=()=>{const e=t.appLocale.getLocalizedStrings().cockpit.onboarding.customer.reamlIdTooltip;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Yr,{children:e.firstLine}),o.jsxRuntimeExports.jsx(Yr,{children:e.secondLine})]})},Yr=s.div``,xn=(e,n)=>{const r=n.includes("bookkeeping"),i=n.includes("zeni_checking"),a=n.includes("zeni_cards"),d=n.includes("zeni_treasury"),l=n.includes("zeni_payroll"),c=n.includes("zeni_cfo"),p=n.includes("zeni_tax"),m=l||c||p,x=["zeni_payroll","zeni_cfo","zeni_tax"],g=["zeni_bill_pay","zeni_reimbursements"],h=["zeni_checking","zeni_cards","zeni_treasury"],j=["zeni_bill_pay","zeni_reimbursements"];return e.map(b=>{const{code:C,name:S}=b,y={label:S,value:C,isDisabled:!1,isFiltered:!1};if(h.includes(C))return y.isDisabled=!0,y.isFiltered=!0,y;if(g.includes(C))return y.isDisabled=!0,y.isFiltered=!1,y;if(m){const f=x.includes(C);return y.isFiltered=!1,y.isDisabled=!f,y}if(r)return C==="bookkeeping"?(y.isDisabled=!1,y.isFiltered=!1):(j.includes(C),y.isDisabled=!0,y.isFiltered=!1),y;if(i||a||d){const E=["bookkeeping","zeni_checking","zeni_cards","zeni_treasury"].includes(C);return y.isFiltered=!E,y.isDisabled=!E,y}return y})},$C=e=>{switch(e){case"ExtraSmall":return t.sp[2];case"Small":return t.sp[3];case"Standard":return t.sp[4];case"Large":return t.sp[5];case"ExtraLarge":return t.sp[7]}},EC=s.div`
|
|
4259
4259
|
color: ${e=>e.theme.colors.primary};
|
|
4260
4260
|
display: flex;
|
|
4261
4261
|
justify-content: center;
|
|
@@ -4265,7 +4265,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
4265
4265
|
border-radius: 50%;
|
|
4266
4266
|
align-items: center;
|
|
4267
4267
|
box-shadow: ${t.Space.sp0} 2px 2px 2px ${t.Colors.boxShadowElevation};
|
|
4268
|
-
`;function wC({size:e,disableShrink:n,reverseSpinnerColor:r,style:i}){const a=o.useTheme(),d=$C(e),l=r?a.colors.grey5:a.colors.primary;return o.jsxRuntimeExports.jsx(EC,{style:{color:l,...i},children:o.jsxRuntimeExports.jsx(o.CircularProgress,{disableShrink:n,size:d,color:"inherit"})})}function vC({size:e,start:n,disableShrink:r,reverseSpinnerColor:i,style:a}){return n?o.jsxRuntimeExports.jsx(wC,{disableShrink:r===!0,size:e,reverseSpinnerColor:i===!0,style:a}):null}const xa=u.forwardRef(({sectionId:e,localData:n,labelWidth:r,groupNameAdditionalLabel:i,groupEmailAdditionalLabel:a,isDisabled:d},l)=>{const c=t.appLocale.getLocalizedStrings().cockpit.onboarding,{emailGroupFetchState:p,newOnboardingCustomerLocalData:m,companyView:x}=n,
|
|
4268
|
+
`;function wC({size:e,disableShrink:n,reverseSpinnerColor:r,style:i}){const a=o.useTheme(),d=$C(e),l=r?a.colors.grey5:a.colors.primary;return o.jsxRuntimeExports.jsx(EC,{style:{color:l,...i},children:o.jsxRuntimeExports.jsx(o.CircularProgress,{disableShrink:n,size:d,color:"inherit"})})}function vC({size:e,start:n,disableShrink:r,reverseSpinnerColor:i,style:a}){return n?o.jsxRuntimeExports.jsx(wC,{disableShrink:r===!0,size:e,reverseSpinnerColor:i===!0,style:a}):null}const xa=u.forwardRef(({sectionId:e,localData:n,labelWidth:r,groupNameAdditionalLabel:i,groupEmailAdditionalLabel:a,isDisabled:d},l)=>{const c=t.appLocale.getLocalizedStrings().cockpit.onboarding,{emailGroupFetchState:p,newOnboardingCustomerLocalData:m,companyView:x}=n,g=p.fetchState!=="Completed"&&m.isEmailGroupCreated==null,h=g||m.isEmailGroupCreated===!0||d!=null?"readonly":d;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[p.fetchState==="In-Progress"?o.jsxRuntimeExports.jsx(IC,{children:o.jsxRuntimeExports.jsx(vC,{size:"Large",start:!0})}):null,o.jsxRuntimeExports.jsxs(kC,{isDisabled:g,ref:l,children:[o.jsxRuntimeExports.jsxs(LC,{children:[o.jsxRuntimeExports.jsx(TC,{children:c.customer.groupCreation}),m.companyId!=null&&o.jsxRuntimeExports.jsx(ua,{isCompleted:x?.company.companyOnboardingInfo.onboardingInfo?.groupCreated.completed===!0})]}),o.jsxRuntimeExports.jsxs(PC,{children:[o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${c.customer.groupName}:`,width:r},text:{type:"text",name:`${e}.groupName`,placeholder:`${c.customer.add} ${c.customer.groupName.toLowerCase()}`,options:{required:m.groupId!=""&&m.groupId!=null}},additionalInfoLabel:i,isDisabled:h}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${c.customer.groupEmail}:`,width:r},text:{type:"email",name:`${e}.groupEmail`,placeholder:`${c.customer.add} ${c.customer.groupEmail.toLowerCase()}`,options:{required:m.groupName!=""&&m.groupName!=null}},additionalInfoLabel:a,isDisabled:h}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${c.customer.groupDescription}:`,width:r},text:{type:"text",name:`${e}.groupDescription`,placeholder:`${c.customer.add} ${c.customer.description.toLowerCase()}`},isDisabled:h})]})]})]})});xa.displayName="GroupCreation";const kC=s.div`
|
|
4269
4269
|
opacity: ${e=>e.isDisabled?.4:1};
|
|
4270
4270
|
display: flex;
|
|
4271
4271
|
flex-direction: column;
|
|
@@ -4361,7 +4361,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
4361
4361
|
color: ${t.Colors.importantDark};
|
|
4362
4362
|
padding: ${t.Space.sp2} ${t.Space.sp2};
|
|
4363
4363
|
border-radius: ${t.Space.sp1};
|
|
4364
|
-
`,Zr="onboardingCustomerPage",GC="companySection",at="groupSection",Ae="customerSection",ha="qboConnectionSection",yo={labelWidth:new t.ResponsiveSized(120,180),largeLabelWidth:new t.ResponsiveSized(120,210,210),extraLargeLabelWidth:new t.ResponsiveSized(240,240,240),descriptionMarginBottom:new t.ResponsiveSized(20,t.sp[3]),titleFontSize:new t.ResponsiveSized(t.sp[3],18),titleLineHeight:new t.ResponsiveSized(t.sp[4],27),buttonWidth:new t.ResponsiveSized(135,135)},{cockpit:{onboarding:je},common:{no:YC,yes:ZC,strings:de}}=t.appLocale.getLocalizedStrings();function XC({localData:e,screenType:n,qboConnectClicked:r,analytics:i,onOnboardingCustomerDataUpdated:a,onCloseClick:d,onSaveClick:l,onViewClick:c,onCompanyDomainBlurred:p,onNavigateToPreOnboarding:m,onQBOConnectClick:x}){const S=o.useTheme(),h=t.useWindowSizeContext(),C=yo.labelWidth.value(h),b=yo.largeLabelWidth.value(h),f=yo.extraLargeLabelWidth.value(h),g=o.useForm({mode:"all",reValidateMode:"onChange",defaultValues:u.useMemo(()=>fo(e),[e])}),{emailGroupFetchState:j,newOnboardingCustomerLocalData:y,onboardingCompletedCompanies:E,isOnboardingAllowedForUser:R,fetchState:I,sendInviteFetchState:A,uiState:v,companyView:T,externalConnections:F}=e,[D,K]=u.useState(de.empty),[M,Y]=u.useState(de.empty),[G]=u.useState(de.empty),[w,P]=u.useState(de.empty),[B,k]=u.useState(de.empty),[O,z]=u.useState(!1),[Z,ie]=u.useState(!1),[N,H]=u.useState(je.customer.completePreOnboardingText),[L,Q]=u.useState(!1),se=u.useRef(null),X=u.useRef(null),re=u.useRef(null),{isExistingCustomer:te,isCustomerOnboardedSuccessfully:he}=tj(e),fe=te&&he?je.customer.customerNameExistInManagementText:je.customer.customerNameExistInOnboardingText,be=u.useMemo(()=>fe.replace("_company-domain_",y.companyEmailDomain??de.empty),[j.fetchState]),W=T?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed,ee=u.useCallback(()=>{const me=g.getValues();return me[Ae].realmId!==me[Ae].confirmRealmId?(P(je.customer.realmIdWarning),g.trigger(`${Ae}.confirmRealmId`),!1):(P(de.empty),g.clearErrors(`${Ae}.confirmRealmId`),!0)},[g]),ge=u.useCallback(()=>{const me=g.getValues();return me[Ae].entityType.selectedOption?.value=="Subsidiary"&&me[Ae].company.selectedOption==null?(g.setError("customerSection.company",{type:"required"}),!1):(g.clearErrors("customerSection.company"),!0)},[g]),ve=u.useCallback(()=>y.customerName?.firstName&&!y.customerName?.lastName||!y.customerName?.firstName&&y.customerName?.lastName?(g.trigger(`${Ae}.customerName`),!1):(y.customerName?.firstName||y.customerName?.lastName)&&!y.email?(g.trigger(`${Ae}.email`),!1):(y.customerName?.firstName||y.customerName?.lastName)&&y.email&&y.selectedProducts?.length===0?(k(je.customer.productsWarning),g.trigger(`${Ae}.products`),!1):!0,[g,y.customerName,y.email,y.selectedProducts]),Re=u.useCallback(()=>ee()&&ge()&&ve(),[ge,ee,ve]),$=g.handleSubmit(()=>{H(je.customer.completePreOnboardingText),Re()&&ie(!0)},()=>{Re(),console.warn("Onboarding customer form error")}),Ce=g.getValues()[Ae].email??de.empty,ae=(me=!1)=>{const q={companyDomain:y.companyEmailDomain??de.empty,primaryContactEmail:Ce},Ne={groupName:y.groupName??de.empty,groupEmail:y.groupId??de.empty,groupDescription:y.groupDescription??de.empty},Qe={firstName:y.customerName?.firstName??de.empty,lastName:y.customerName?.lastName??de.empty,customerEmail:Ce,companyName:y.name??de.empty,entittyType:y.isSubsidiary===!0?je.customer.subsidiary:je.customer.parent??de.empty,chargebeeId:y.chargebeeId??de.empty,products:y.selectedProducts??[],qboRealmId:y.qboRealmId??de.empty,hubSpotId:y.hubSpotId},Ge={isSendInvite:me,isInviteAlreadySent:T?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0,isZeniManagedQboConnectionSelected:y.accountingConnectionCreationMode==="zeni_user",isCustomerManagedQboConnectionSelected:y.accountingConnectionCreationMode==="customer",qboConnectionStatus:T?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed??!1};i?.trackOnboardingSaveOrSendInvite(q,Ne,Qe,Ge)},ce=()=>{const me={companyEmailDomain:y.companyEmailDomain??de.empty,primaryContactEmail:Ce},q={groupName:y.groupName??de.empty,groupEmail:y.groupId??de.empty,groupDescription:y.groupDescription??de.empty,isCompanyEmailDomainAvailable:!0};i?.trackOnboardingNewCustomerGroupCreationCheck(me,q)},$e=()=>{let me=!0;const q=g.getValues();if(q[at].groupEmail!==de.empty&&q[at].groupName===de.empty)K(je.customer.groupNameWarning),g.setError("groupSection.groupName",{type:"required"}),me=!1;else if(q[at].groupName!==de.empty&&q[at].groupEmail===de.empty)Y(je.customer.groupEmailWarning),g.setError("groupSection.groupEmail",{type:"required"}),me=!1;else{const{error:Ne}=g.getFieldState("groupSection.groupName"),{error:Qe}=g.getFieldState("groupSection.groupEmail");(Ne==null||Ne.type==="required")&&(Qe==null||Qe.type==="required")&&(me=!1,g.clearErrors("groupSection")),K(de.empty),Y(de.empty)}return me},V={onOkClick:()=>{z(!1),g.reset(),d()},onCancelClick:()=>{z(!1)}},_={onOkClick:()=>{ie(!1),l(!0),ae(!0)},onCancelClick:()=>{ie(!1)}},pe=async(me,q)=>{const Ne={...q};if(me.includes("groupName")&&q[at].groupName!=de.empty&&(q[at].groupName=q[at].groupName.charAt(0).toUpperCase()+q[at].groupName.slice(1)),(me.includes("groupName")||me.includes("groupEmail"))&&$e(),me.includes("confirmRealmId")&&P(de.empty),me.includes("products")&&o.isEqual(y.selectedProducts??[],q[Ae].products.selectedOptions)===!1){k(de.empty);const Qe=oj(y.selectedProducts??[],q[Ae].products.selectedOptions.map(Et=>J.toProductTypeStrict(Et)).filter(Et=>Et!=null));Ne[Ae].products.selectedOptions=Qe;const Ge=xn(e.allProductsList,Qe);g.setValue(`${Ae}.products`,{allOptions:Ge,selectedOptions:Qe})}me.includes("realmId")&&o.has(g.formState.errors,`${Ae}.confirmRealmId`)&&g.trigger(`${Ae}.confirmRealmId`),a(Ne)},ye=me=>{const{dirtyFields:q}=g.formState;q.companySection?.companyDomain===!0&&p(me)},ke=()=>{Object.keys(g.formState.errors).length===0&&(m?.(),H(de.empty))},ue=()=>{j.fetchState==="Error"?p(y.companyEmailDomain):Re()&&Object.keys(g.formState.errors).length===0&&(l(A.fetchState==="Error"),ae())},U=()=>{Re()&&Object.keys(g.formState.errors).length===0&&(l(!1),ae())};u.useEffect(()=>{const me=g.watch((q,{name:Ne})=>{Ne!=null&&q!=null&&o.defer(()=>pe(Ne,q))});return()=>{me.unsubscribe()}}),u.useEffect(()=>{y.isCustomerCreationDisabled===!0&&(g.resetField("customerSection",{defaultValue:fo(e)[Ae],keepDirty:!0}),g.clearErrors("customerSection"))},[y.isCustomerCreationDisabled]),u.useEffect(()=>{Q(y.isSubsidiary===!0),y.isSubsidiary!==!0&&g.resetField("customerSection.company",{defaultValue:fo(e)[Ae].company,keepDirty:!0}),g.resetField("customerSection.entityType",{defaultValue:fo(e)[Ae].entityType,keepDirty:!0})},[y.isSubsidiary]),u.useEffect(()=>{j.fetchState==="Completed"&&(g.reset(fo(e)),te||ce())},[j.fetchState]),u.useEffect(()=>{v.selectedStep==="STEP_1"?se.current?.scrollIntoView():v.selectedStep==="STEP_2"?X.current?.scrollIntoView():v.selectedStep==="STEP_3"&&re.current?.scrollIntoView()},[]),u.useEffect(()=>{const me=T?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed;if(F?.saveConnectionState==="Error"){const Ne={firstName:y.customerName?.firstName??de.empty,lastName:y.customerName?.lastName??de.empty,customerEmail:g.getValues()[Ae].email??de.empty,qboConnectionResponseMessage:je.qboErrorText,isSuccess:!1};i?.trackOnboardingZeniManagedQBOConnection(Ne)}else if(me??!1){const Ne={firstName:y.customerName?.firstName??de.empty,lastName:y.customerName?.lastName??de.empty,customerEmail:g.getValues()[Ae].email??de.empty,qboConnectionResponseMessage:je.qboSuccessText,isSuccess:!0};i?.trackOnboardingZeniManagedQBOConnection(Ne)}},[F?.saveConnectionState,T?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed]),u.useEffect(()=>{if(y.accountingConnectionCreationMode){const me=T?.company.companyOnboardingInfo.onboardingInfo?.accountingConnectionCreationMode??de.empty;if(y.accountingConnectionCreationMode!==me){const q={firstName:y.customerName?.firstName??de.empty,lastName:y.customerName?.lastName??de.empty,customerEmail:g.getValues()[Ae].email??de.empty,isZeniOrCustomer:y.accountingConnectionCreationMode??de.empty};i?.trackOnboardingQBOConnectionSelected(q)}}},[y.accountingConnectionCreationMode]);const Oe=(me,q)=>{const{fetchState:Ne}=me,{isEmailGroupCreated:Qe,selectedProducts:Ge}=q,Et=Ne!=="Completed"&&Qe==null,no=Ge==null||Ge.length===0,Ut=(Ge?.includes("zeni_checking")===!0||Ge?.includes("zeni_treasury")===!0||Ge?.includes("zeni_cards")===!0||Ge?.includes("zeni_payroll")===!0||Ge?.includes("zeni_cfo")===!0||Ge?.includes("zeni_tax")===!0)&&Ge?.includes("bookkeeping")===!1;return Et||no||Ut},Pe=u.useMemo(()=>{const me=g.formState.isValid,q=y.selectedProducts!=null&&(y.selectedProducts.includes("zeni_payroll")===!0||y.selectedProducts.includes("zeni_cfo")===!0||y.selectedProducts.includes("zeni_tax")===!0),Ne=y.selectedProducts!=null&&(y.selectedProducts.includes("zeni_checking")===!0||y.selectedProducts.includes("zeni_cards")===!0||q)&&y.selectedProducts.includes("bookkeeping")===!1;return me!==!0||j.fetchState==="In-Progress"||j.fetchState==="Error"||I==="In-Progress"||I==="Error"||R!==!0||y.selectedProducts==null||y.selectedProducts.length===0||y.accountingConnectionCreationMode==null&&!Ne||y.accountingConnectionCreationMode==="zeni_user"&&W!==!0&&!Ne||j.fetchState==="Completed"&&te||T?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted===!0},[j.fetchState,te,R,I,g.formState.isValid,y.accountingConnectionCreationMode,W,y.selectedProducts,T?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted]),Be=u.useMemo(()=>A.fetchState!=="In-Progress"&&A.fetchState!=="Error"&&I!=="In-Progress"&&I!=="Error"&&j.fetchState!=="In-Progress"&&te===!0,[j.fetchState,te,I,A.fetchState]);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[O===!0?o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{children:je.discardTitle}),descriptionComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:je.discardDescription}),primaryButtonText:je.delete,secondaryButtonText:je.cancel,proceedButtonVariant:"destructive",action:V,style:{background:t.Colors.overlayDark}}):null,Z===!0?o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{style:{paddingLeft:t.Space.sp6,paddingRight:t.Space.sp6},children:je.confirmationPopup.title}),descriptionComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:je.confirmationPopup.subTitle}),primaryButtonText:ZC,secondaryButtonText:YC,action:_,style:{background:t.Colors.overlayDark}}):null,o.jsxRuntimeExports.jsx(t.NavBarWithClose,{title:n==="create"?je.customer.modalNewCustomerText:je.customer.modalEditCustomerText,backgroundColor:S.colors.grey5,style:{zIndex:4},onCloseClick:()=>{Object.keys(g.formState.dirtyFields).length>0?z(!0):(g.reset(),d())}}),o.jsxRuntimeExports.jsxs(qC,{children:[o.jsxRuntimeExports.jsx(QC,{children:je.customer.subTitle}),o.jsxRuntimeExports.jsx(o.FormProvider,{...g,children:o.jsxRuntimeExports.jsxs("form",{id:`${Zr}_form`,onSubmit:$,children:[o.jsxRuntimeExports.jsx(L2,{localData:e,labelWidth:C,onCompanyDomainBlurred:ye,primaryEmailDomainAdditionalLabel:G,isOnboardingAllowedForUser:R}),Be===!0?o.jsxRuntimeExports.jsxs(Xn,{children:[o.jsxRuntimeExports.jsxs(qn,{children:[o.jsxRuntimeExports.jsxs(Xr,{children:[o.jsxRuntimeExports.jsx(Zn,{}),o.jsxRuntimeExports.jsx(t.StandardMedium,{children:je.customer.groupCreationError})]}),o.jsxRuntimeExports.jsx(ej,{children:be})]}),o.jsxRuntimeExports.jsx(t.Button,{style:{padding:`${t.Space.sp1} ${t.Space.sp2}`,backgroundColor:S.colors.champion,borderColor:S.colors.champion,color:S.mode==="light"?t.darkColors.primary:t.lightColors.primary,height:"30px",width:t.Space.sp7},label:je.customer.view,size:"small",onClick:()=>{c(he?"management":"onboarding")}})]}):null,j.fetchState==="Error"||I==="Error"||A.fetchState==="Error"&&e.error!=null&&e.error?.code!==406?o.jsxRuntimeExports.jsxs(Xn,{children:[o.jsxRuntimeExports.jsx(qn,{children:o.jsxRuntimeExports.jsxs(Xr,{children:[o.jsxRuntimeExports.jsx(Zn,{}),o.jsxRuntimeExports.jsx(t.LargeMedium,{children:je.customer.emailgroupAPIError})]})}),o.jsxRuntimeExports.jsx(t.Button,{style:{padding:`${t.Space.sp1} ${t.Space.sp2}`,backgroundColor:S.colors.champion,borderColor:S.colors.champion,color:S.mode==="light"?t.darkColors.primary:t.lightColors.primary},label:je.customer.tryAgainText,size:"small",onClick:ue})]}):null,A.fetchState==="Error"&&e.error!=null&&e.error?.code===406?o.jsxRuntimeExports.jsxs(Xn,{children:[o.jsxRuntimeExports.jsx(Zn,{}),o.jsxRuntimeExports.jsxs(qn,{children:[o.jsxRuntimeExports.jsx(t.LargeMedium,{children:N!==de.empty?je.customer.preOnboardingError:je.customer.preOnboardingSaveError}),N!==de.empty?o.jsxRuntimeExports.jsx(t.Button,{style:{padding:`${t.Space.sp1} ${t.Space.sp2}`,backgroundColor:S.colors.champion,borderColor:S.colors.champion,color:S.mode==="light"?t.darkColors.primary:t.lightColors.primary},label:N,size:"small",onClick:ke}):null]})]}):null,o.jsxRuntimeExports.jsx(xa,{groupEmailAdditionalLabel:M,groupNameAdditionalLabel:D,labelWidth:C,localData:e,ref:se,sectionId:at}),o.jsxRuntimeExports.jsx(ma,{localData:e,onboardedCompanies:E.companies,isSubsidiary:L,labelWidth:C,largeLabelWidth:b,extraLargeLabelWidth:f,realmIdAdditionalLabel:w,productsAdditionalLabel:B,ref:X,sectionId:Ae,isDisabled:R===!1?"disabled":void 0}),o.jsxRuntimeExports.jsx(JC,{children:o.jsxRuntimeExports.jsx(AC,{isSectionDisabled:Oe(j,y),sectionId:ha,isLoading:r===!0||F?.fetchState==="In-Progress"||F?.saveConnectionState==="In-Progress",accountingConnectionCreationMode:e.newOnboardingCustomerLocalData.accountingConnectionCreationMode,onQBOConnectClick:x,isConnected:T?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed===!0,isInviteSent:T?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0||T?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted===!0,saveConnectionState:F?.saveConnectionState})})]})})]}),o.jsxRuntimeExports.jsx(t.Footer,{formId:`${Zr}_form`,primaryBtn:{label:T?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0?je.customer.resendInviteBtnText:je.customer.sendInviteBtnText,style:{width:yo.buttonWidth.value(h),display:"flex",alignItems:"center",justifyContent:"center"},isLoading:A.fetchState==="In-Progress",isDisabled:Pe},cancelBtn:{label:je.customer.saveBtnText,style:{width:yo.buttonWidth.value(h),display:"flex",alignItems:"center",justifyContent:"center"},isDisabled:!(t.formHasDirtyFields(g.formState.dirtyFields)||e.emailGroupFetchState.fetchState==="Completed"),isLoading:I==="In-Progress"&&r===!1,shouldResetOnCancel:!1,onClick:U,reverseSpinnerColor:!1}})]})}const fo=e=>{const{newOnboardingCustomerLocalData:n,onboardingCompletedCompanies:r}=e;let i;const a=r.companies.find(d=>d.companyInfo.companyId===n.parentCompanyId);return a!=null&&(i={label:a.companyInfo.name,value:a.companyInfo.companyId}),{[GC]:{companyDomain:n.companyEmailDomain??de.empty},[at]:{groupName:n.groupName??de.empty,groupEmail:n.groupId??de.empty,groupDescription:n.groupDescription??de.empty},[Ae]:{name:n.name??de.empty,entityType:{allOptions:[{label:je.customer.parent,value:je.customer.parent},{label:je.customer.subsidiary,value:je.customer.subsidiary}],selectedOption:n.isSubsidiary===!0?{label:je.customer.subsidiary,value:je.customer.subsidiary}:{label:je.customer.parent,value:je.customer.parent}},company:{selectedOption:i,allOptions:r.companies.map(d=>({label:d.companyInfo.name,value:d.companyInfo.companyId}))},realmId:n.qboRealmId??de.empty,confirmRealmId:n.qboRealmId??de.empty,chargebeeId:n.chargebeeId??de.empty,hubSpotId:n.hubSpotId??de.empty,email:n.email??de.empty,customerName:n.customerName??{firstName:de.empty,lastName:de.empty},products:{allOptions:xn(e.allProductsList,n.selectedProducts??[]),selectedOptions:n.selectedProducts??[]}},[ha]:{accountingConnectionCreationMode:n.accountingConnectionCreationMode}}},qC=s.div`
|
|
4364
|
+
`,Zr="onboardingCustomerPage",GC="companySection",at="groupSection",Ae="customerSection",ha="qboConnectionSection",yo={labelWidth:new t.ResponsiveSized(120,180),largeLabelWidth:new t.ResponsiveSized(120,210,210),extraLargeLabelWidth:new t.ResponsiveSized(240,240,240),descriptionMarginBottom:new t.ResponsiveSized(20,t.sp[3]),titleFontSize:new t.ResponsiveSized(t.sp[3],18),titleLineHeight:new t.ResponsiveSized(t.sp[4],27),buttonWidth:new t.ResponsiveSized(135,135)},{cockpit:{onboarding:je},common:{no:YC,yes:ZC,strings:de}}=t.appLocale.getLocalizedStrings();function XC({localData:e,screenType:n,qboConnectClicked:r,analytics:i,onOnboardingCustomerDataUpdated:a,onCloseClick:d,onSaveClick:l,onViewClick:c,onCompanyDomainBlurred:p,onNavigateToPreOnboarding:m,onQBOConnectClick:x}){const g=o.useTheme(),h=t.useWindowSizeContext(),j=yo.labelWidth.value(h),b=yo.largeLabelWidth.value(h),C=yo.extraLargeLabelWidth.value(h),S=o.useForm({mode:"all",reValidateMode:"onChange",defaultValues:u.useMemo(()=>fo(e),[e])}),{emailGroupFetchState:y,newOnboardingCustomerLocalData:f,onboardingCompletedCompanies:E,isOnboardingAllowedForUser:R,fetchState:I,sendInviteFetchState:A,uiState:v,companyView:T,externalConnections:F}=e,[D,K]=u.useState(de.empty),[M,Y]=u.useState(de.empty),[G]=u.useState(de.empty),[w,P]=u.useState(de.empty),[B,k]=u.useState(de.empty),[O,z]=u.useState(!1),[Z,ie]=u.useState(!1),[N,H]=u.useState(je.customer.completePreOnboardingText),[L,Q]=u.useState(!1),se=u.useRef(null),X=u.useRef(null),re=u.useRef(null),{isExistingCustomer:te,isCustomerOnboardedSuccessfully:he}=tj(e),fe=te&&he?je.customer.customerNameExistInManagementText:je.customer.customerNameExistInOnboardingText,be=u.useMemo(()=>fe.replace("_company-domain_",f.companyEmailDomain??de.empty),[y.fetchState]),W=T?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed,ee=u.useCallback(()=>{const me=S.getValues();return me[Ae].realmId!==me[Ae].confirmRealmId?(P(je.customer.realmIdWarning),S.trigger(`${Ae}.confirmRealmId`),!1):(P(de.empty),S.clearErrors(`${Ae}.confirmRealmId`),!0)},[S]),ge=u.useCallback(()=>{const me=S.getValues();return me[Ae].entityType.selectedOption?.value=="Subsidiary"&&me[Ae].company.selectedOption==null?(S.setError("customerSection.company",{type:"required"}),!1):(S.clearErrors("customerSection.company"),!0)},[S]),ve=u.useCallback(()=>f.customerName?.firstName&&!f.customerName?.lastName||!f.customerName?.firstName&&f.customerName?.lastName?(S.trigger(`${Ae}.customerName`),!1):(f.customerName?.firstName||f.customerName?.lastName)&&!f.email?(S.trigger(`${Ae}.email`),!1):(f.customerName?.firstName||f.customerName?.lastName)&&f.email&&f.selectedProducts?.length===0?(k(je.customer.productsWarning),S.trigger(`${Ae}.products`),!1):!0,[S,f.customerName,f.email,f.selectedProducts]),Re=u.useCallback(()=>ee()&&ge()&&ve(),[ge,ee,ve]),$=S.handleSubmit(()=>{H(je.customer.completePreOnboardingText),Re()&&ie(!0)},()=>{Re(),console.warn("Onboarding customer form error")}),Ce=S.getValues()[Ae].email??de.empty,ae=(me=!1)=>{const q={companyDomain:f.companyEmailDomain??de.empty,primaryContactEmail:Ce},Ne={groupName:f.groupName??de.empty,groupEmail:f.groupId??de.empty,groupDescription:f.groupDescription??de.empty},Qe={firstName:f.customerName?.firstName??de.empty,lastName:f.customerName?.lastName??de.empty,customerEmail:Ce,companyName:f.name??de.empty,entittyType:f.isSubsidiary===!0?je.customer.subsidiary:je.customer.parent??de.empty,chargebeeId:f.chargebeeId??de.empty,products:f.selectedProducts??[],qboRealmId:f.qboRealmId??de.empty,hubSpotId:f.hubSpotId},Ge={isSendInvite:me,isInviteAlreadySent:T?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0,isZeniManagedQboConnectionSelected:f.accountingConnectionCreationMode==="zeni_user",isCustomerManagedQboConnectionSelected:f.accountingConnectionCreationMode==="customer",qboConnectionStatus:T?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed??!1};i?.trackOnboardingSaveOrSendInvite(q,Ne,Qe,Ge)},ce=()=>{const me={companyEmailDomain:f.companyEmailDomain??de.empty,primaryContactEmail:Ce},q={groupName:f.groupName??de.empty,groupEmail:f.groupId??de.empty,groupDescription:f.groupDescription??de.empty,isCompanyEmailDomainAvailable:!0};i?.trackOnboardingNewCustomerGroupCreationCheck(me,q)},$e=()=>{let me=!0;const q=S.getValues();if(q[at].groupEmail!==de.empty&&q[at].groupName===de.empty)K(je.customer.groupNameWarning),S.setError("groupSection.groupName",{type:"required"}),me=!1;else if(q[at].groupName!==de.empty&&q[at].groupEmail===de.empty)Y(je.customer.groupEmailWarning),S.setError("groupSection.groupEmail",{type:"required"}),me=!1;else{const{error:Ne}=S.getFieldState("groupSection.groupName"),{error:Qe}=S.getFieldState("groupSection.groupEmail");(Ne==null||Ne.type==="required")&&(Qe==null||Qe.type==="required")&&(me=!1,S.clearErrors("groupSection")),K(de.empty),Y(de.empty)}return me},V={onOkClick:()=>{z(!1),S.reset(),d()},onCancelClick:()=>{z(!1)}},_={onOkClick:()=>{ie(!1),l(!0),ae(!0)},onCancelClick:()=>{ie(!1)}},pe=async(me,q)=>{const Ne={...q};if(me.includes("groupName")&&q[at].groupName!=de.empty&&(q[at].groupName=q[at].groupName.charAt(0).toUpperCase()+q[at].groupName.slice(1)),(me.includes("groupName")||me.includes("groupEmail"))&&$e(),me.includes("confirmRealmId")&&P(de.empty),me.includes("products")&&o.isEqual(f.selectedProducts??[],q[Ae].products.selectedOptions)===!1){k(de.empty);const Qe=oj(f.selectedProducts??[],q[Ae].products.selectedOptions.map(Et=>J.toProductTypeStrict(Et)).filter(Et=>Et!=null));Ne[Ae].products.selectedOptions=Qe;const Ge=xn(e.allProductsList,Qe);S.setValue(`${Ae}.products`,{allOptions:Ge,selectedOptions:Qe})}me.includes("realmId")&&o.has(S.formState.errors,`${Ae}.confirmRealmId`)&&S.trigger(`${Ae}.confirmRealmId`),a(Ne)},ye=me=>{const{dirtyFields:q}=S.formState;q.companySection?.companyDomain===!0&&p(me)},ke=()=>{Object.keys(S.formState.errors).length===0&&(m?.(),H(de.empty))},ue=()=>{y.fetchState==="Error"?p(f.companyEmailDomain):Re()&&Object.keys(S.formState.errors).length===0&&(l(A.fetchState==="Error"),ae())},U=()=>{Re()&&Object.keys(S.formState.errors).length===0&&(l(!1),ae())};u.useEffect(()=>{const me=S.watch((q,{name:Ne})=>{Ne!=null&&q!=null&&o.defer(()=>pe(Ne,q))});return()=>{me.unsubscribe()}}),u.useEffect(()=>{f.isCustomerCreationDisabled===!0&&(S.resetField("customerSection",{defaultValue:fo(e)[Ae],keepDirty:!0}),S.clearErrors("customerSection"))},[f.isCustomerCreationDisabled]),u.useEffect(()=>{Q(f.isSubsidiary===!0),f.isSubsidiary!==!0&&S.resetField("customerSection.company",{defaultValue:fo(e)[Ae].company,keepDirty:!0}),S.resetField("customerSection.entityType",{defaultValue:fo(e)[Ae].entityType,keepDirty:!0})},[f.isSubsidiary]),u.useEffect(()=>{y.fetchState==="Completed"&&(S.reset(fo(e)),te||ce())},[y.fetchState]),u.useEffect(()=>{v.selectedStep==="STEP_1"?se.current?.scrollIntoView():v.selectedStep==="STEP_2"?X.current?.scrollIntoView():v.selectedStep==="STEP_3"&&re.current?.scrollIntoView()},[]),u.useEffect(()=>{const me=T?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed;if(F?.saveConnectionState==="Error"){const Ne={firstName:f.customerName?.firstName??de.empty,lastName:f.customerName?.lastName??de.empty,customerEmail:S.getValues()[Ae].email??de.empty,qboConnectionResponseMessage:je.qboErrorText,isSuccess:!1};i?.trackOnboardingZeniManagedQBOConnection(Ne)}else if(me??!1){const Ne={firstName:f.customerName?.firstName??de.empty,lastName:f.customerName?.lastName??de.empty,customerEmail:S.getValues()[Ae].email??de.empty,qboConnectionResponseMessage:je.qboSuccessText,isSuccess:!0};i?.trackOnboardingZeniManagedQBOConnection(Ne)}},[F?.saveConnectionState,T?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed]),u.useEffect(()=>{if(f.accountingConnectionCreationMode){const me=T?.company.companyOnboardingInfo.onboardingInfo?.accountingConnectionCreationMode??de.empty;if(f.accountingConnectionCreationMode!==me){const q={firstName:f.customerName?.firstName??de.empty,lastName:f.customerName?.lastName??de.empty,customerEmail:S.getValues()[Ae].email??de.empty,isZeniOrCustomer:f.accountingConnectionCreationMode??de.empty};i?.trackOnboardingQBOConnectionSelected(q)}}},[f.accountingConnectionCreationMode]);const Oe=(me,q)=>{const{fetchState:Ne}=me,{isEmailGroupCreated:Qe,selectedProducts:Ge}=q,Et=Ne!=="Completed"&&Qe==null,no=Ge==null||Ge.length===0,Ut=(Ge?.includes("zeni_checking")===!0||Ge?.includes("zeni_treasury")===!0||Ge?.includes("zeni_cards")===!0||Ge?.includes("zeni_payroll")===!0||Ge?.includes("zeni_cfo")===!0||Ge?.includes("zeni_tax")===!0)&&Ge?.includes("bookkeeping")===!1;return Et||no||Ut},Pe=u.useMemo(()=>{const me=S.formState.isValid,q=f.selectedProducts!=null&&(f.selectedProducts.includes("zeni_payroll")===!0||f.selectedProducts.includes("zeni_cfo")===!0||f.selectedProducts.includes("zeni_tax")===!0),Ne=f.selectedProducts!=null&&(f.selectedProducts.includes("zeni_checking")===!0||f.selectedProducts.includes("zeni_cards")===!0||q)&&f.selectedProducts.includes("bookkeeping")===!1;return me!==!0||y.fetchState==="In-Progress"||y.fetchState==="Error"||I==="In-Progress"||I==="Error"||R!==!0||f.selectedProducts==null||f.selectedProducts.length===0||f.accountingConnectionCreationMode==null&&!Ne||f.accountingConnectionCreationMode==="zeni_user"&&W!==!0&&!Ne||y.fetchState==="Completed"&&te||T?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted===!0},[y.fetchState,te,R,I,S.formState.isValid,f.accountingConnectionCreationMode,W,f.selectedProducts,T?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted]),Be=u.useMemo(()=>A.fetchState!=="In-Progress"&&A.fetchState!=="Error"&&I!=="In-Progress"&&I!=="Error"&&y.fetchState!=="In-Progress"&&te===!0,[y.fetchState,te,I,A.fetchState]);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[O===!0?o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{children:je.discardTitle}),descriptionComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:je.discardDescription}),primaryButtonText:je.delete,secondaryButtonText:je.cancel,proceedButtonVariant:"destructive",action:V,style:{background:t.Colors.overlayDark}}):null,Z===!0?o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{style:{paddingLeft:t.Space.sp6,paddingRight:t.Space.sp6},children:je.confirmationPopup.title}),descriptionComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:je.confirmationPopup.subTitle}),primaryButtonText:ZC,secondaryButtonText:YC,action:_,style:{background:t.Colors.overlayDark}}):null,o.jsxRuntimeExports.jsx(t.NavBarWithClose,{title:n==="create"?je.customer.modalNewCustomerText:je.customer.modalEditCustomerText,backgroundColor:g.colors.grey5,style:{zIndex:4},onCloseClick:()=>{Object.keys(S.formState.dirtyFields).length>0?z(!0):(S.reset(),d())}}),o.jsxRuntimeExports.jsxs(qC,{children:[o.jsxRuntimeExports.jsx(QC,{children:je.customer.subTitle}),o.jsxRuntimeExports.jsx(o.FormProvider,{...S,children:o.jsxRuntimeExports.jsxs("form",{id:`${Zr}_form`,onSubmit:$,children:[o.jsxRuntimeExports.jsx(L2,{localData:e,labelWidth:j,onCompanyDomainBlurred:ye,primaryEmailDomainAdditionalLabel:G,isOnboardingAllowedForUser:R}),Be===!0?o.jsxRuntimeExports.jsxs(Xn,{children:[o.jsxRuntimeExports.jsxs(qn,{children:[o.jsxRuntimeExports.jsxs(Xr,{children:[o.jsxRuntimeExports.jsx(Zn,{}),o.jsxRuntimeExports.jsx(t.StandardMedium,{children:je.customer.groupCreationError})]}),o.jsxRuntimeExports.jsx(ej,{children:be})]}),o.jsxRuntimeExports.jsx(t.Button,{style:{padding:`${t.Space.sp1} ${t.Space.sp2}`,backgroundColor:g.colors.champion,borderColor:g.colors.champion,color:g.mode==="light"?t.darkColors.primary:t.lightColors.primary,height:"30px",width:t.Space.sp7},label:je.customer.view,size:"small",onClick:()=>{c(he?"management":"onboarding")}})]}):null,y.fetchState==="Error"||I==="Error"||A.fetchState==="Error"&&e.error!=null&&e.error?.code!==406?o.jsxRuntimeExports.jsxs(Xn,{children:[o.jsxRuntimeExports.jsx(qn,{children:o.jsxRuntimeExports.jsxs(Xr,{children:[o.jsxRuntimeExports.jsx(Zn,{}),o.jsxRuntimeExports.jsx(t.LargeMedium,{children:je.customer.emailgroupAPIError})]})}),o.jsxRuntimeExports.jsx(t.Button,{style:{padding:`${t.Space.sp1} ${t.Space.sp2}`,backgroundColor:g.colors.champion,borderColor:g.colors.champion,color:g.mode==="light"?t.darkColors.primary:t.lightColors.primary},label:je.customer.tryAgainText,size:"small",onClick:ue})]}):null,A.fetchState==="Error"&&e.error!=null&&e.error?.code===406?o.jsxRuntimeExports.jsxs(Xn,{children:[o.jsxRuntimeExports.jsx(Zn,{}),o.jsxRuntimeExports.jsxs(qn,{children:[o.jsxRuntimeExports.jsx(t.LargeMedium,{children:N!==de.empty?je.customer.preOnboardingError:je.customer.preOnboardingSaveError}),N!==de.empty?o.jsxRuntimeExports.jsx(t.Button,{style:{padding:`${t.Space.sp1} ${t.Space.sp2}`,backgroundColor:g.colors.champion,borderColor:g.colors.champion,color:g.mode==="light"?t.darkColors.primary:t.lightColors.primary},label:N,size:"small",onClick:ke}):null]})]}):null,o.jsxRuntimeExports.jsx(xa,{groupEmailAdditionalLabel:M,groupNameAdditionalLabel:D,labelWidth:j,localData:e,ref:se,sectionId:at}),o.jsxRuntimeExports.jsx(ma,{localData:e,onboardedCompanies:E.companies,isSubsidiary:L,labelWidth:j,largeLabelWidth:b,extraLargeLabelWidth:C,realmIdAdditionalLabel:w,productsAdditionalLabel:B,ref:X,sectionId:Ae,isDisabled:R===!1?"disabled":void 0}),o.jsxRuntimeExports.jsx(JC,{children:o.jsxRuntimeExports.jsx(AC,{isSectionDisabled:Oe(y,f),sectionId:ha,isLoading:r===!0||F?.fetchState==="In-Progress"||F?.saveConnectionState==="In-Progress",accountingConnectionCreationMode:e.newOnboardingCustomerLocalData.accountingConnectionCreationMode,onQBOConnectClick:x,isConnected:T?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed===!0,isInviteSent:T?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0||T?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted===!0,saveConnectionState:F?.saveConnectionState})})]})})]}),o.jsxRuntimeExports.jsx(t.Footer,{formId:`${Zr}_form`,primaryBtn:{label:T?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0?je.customer.resendInviteBtnText:je.customer.sendInviteBtnText,style:{width:yo.buttonWidth.value(h),display:"flex",alignItems:"center",justifyContent:"center"},isLoading:A.fetchState==="In-Progress",isDisabled:Pe},cancelBtn:{label:je.customer.saveBtnText,style:{width:yo.buttonWidth.value(h),display:"flex",alignItems:"center",justifyContent:"center"},isDisabled:!(t.formHasDirtyFields(S.formState.dirtyFields)||e.emailGroupFetchState.fetchState==="Completed"),isLoading:I==="In-Progress"&&r===!1,shouldResetOnCancel:!1,onClick:U,reverseSpinnerColor:!1}})]})}const fo=e=>{const{newOnboardingCustomerLocalData:n,onboardingCompletedCompanies:r}=e;let i;const a=r.companies.find(d=>d.companyInfo.companyId===n.parentCompanyId);return a!=null&&(i={label:a.companyInfo.name,value:a.companyInfo.companyId}),{[GC]:{companyDomain:n.companyEmailDomain??de.empty},[at]:{groupName:n.groupName??de.empty,groupEmail:n.groupId??de.empty,groupDescription:n.groupDescription??de.empty},[Ae]:{name:n.name??de.empty,entityType:{allOptions:[{label:je.customer.parent,value:je.customer.parent},{label:je.customer.subsidiary,value:je.customer.subsidiary}],selectedOption:n.isSubsidiary===!0?{label:je.customer.subsidiary,value:je.customer.subsidiary}:{label:je.customer.parent,value:je.customer.parent}},company:{selectedOption:i,allOptions:r.companies.map(d=>({label:d.companyInfo.name,value:d.companyInfo.companyId}))},realmId:n.qboRealmId??de.empty,confirmRealmId:n.qboRealmId??de.empty,chargebeeId:n.chargebeeId??de.empty,hubSpotId:n.hubSpotId??de.empty,email:n.email??de.empty,customerName:n.customerName??{firstName:de.empty,lastName:de.empty},products:{allOptions:xn(e.allProductsList,n.selectedProducts??[]),selectedOptions:n.selectedProducts??[]}},[ha]:{accountingConnectionCreationMode:n.accountingConnectionCreationMode}}},qC=s.div`
|
|
4365
4365
|
display: flex;
|
|
4366
4366
|
justify-content: flex-start;
|
|
4367
4367
|
height: 100%;
|
|
@@ -4401,7 +4401,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
4401
4401
|
gap: ${t.Space.sp2};
|
|
4402
4402
|
`,ej=s(t.StandardMedium)`
|
|
4403
4403
|
margin-left: ${t.Space.sp4};
|
|
4404
|
-
`,tj=e=>{const{newOnboardingCustomerLocalData:n}=e,{isOnboardingCompleted:r}=n;return{isExistingCustomer:r!=null,isCustomerOnboardedSuccessfully:r!=null&&r===!0}},oj=(e,n)=>{const r=["zeni_payroll","zeni_cfo","zeni_tax"],i=["bookkeeping","zeni_bill_pay","
|
|
4404
|
+
`,tj=e=>{const{newOnboardingCustomerLocalData:n}=e,{isOnboardingCompleted:r}=n;return{isExistingCustomer:r!=null,isCustomerOnboardedSuccessfully:r!=null&&r===!0}},oj=(e,n)=>{const r=["zeni_payroll","zeni_cfo","zeni_tax"],i=["bookkeeping","zeni_bill_pay","zeni_reimbursements"],a=e.includes("bookkeeping"),d=n.includes("bookkeeping"),l=e.filter(x=>r.includes(x)),c=n.filter(x=>r.includes(x)),p=l.length>0,m=c.length>0;return!p&&m?c:p&&!m?[]:!a&&d?i:a&&!d?[]:m?c:n},nj=s.div`
|
|
4405
4405
|
background-color: ${e=>e.highlight?e.theme.colors.brandColorGoldLight:e.theme.colors.grey5};
|
|
4406
4406
|
border: ${e=>`1px solid ${e.highlight?e.theme.colors.brandColorGoldDark:e.theme.colors.background}`};
|
|
4407
4407
|
border-radius: ${t.Space.sp2};
|
|
@@ -4456,7 +4456,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
4456
4456
|
`,hj=s(t.SvgArrowRight)`
|
|
4457
4457
|
width: ${t.Space.sp4};
|
|
4458
4458
|
height: ${t.Space.sp4};
|
|
4459
|
-
`,ga=u.forwardRef(({highlight:e,auditSummaryData:n,isAuditScoreLoadingCompleted:r,onClickAuditScore:i},a)=>{const{cockpit:d,common:l,dateFormat:{visual:c}}=t.appLocale.getLocalizedStrings(),p=t.useWindowSizeContext(),m=n.auditSummary,x=!r||n.fetchState==="In-Progress"||n.fetchState==="Not-Started",
|
|
4459
|
+
`,ga=u.forwardRef(({highlight:e,auditSummaryData:n,isAuditScoreLoadingCompleted:r,onClickAuditScore:i},a)=>{const{cockpit:d,common:l,dateFormat:{visual:c}}=t.appLocale.getLocalizedStrings(),p=t.useWindowSizeContext(),m=n.auditSummary,x=!r||n.fetchState==="In-Progress"||n.fetchState==="Not-Started",g=o.useTheme();let h;return m.bypassedAuditScore<=50?h=t.Colors.important:m.bypassedAuditScore<=75?h=t.Colors.alert:h=t.Colors.success,o.jsxRuntimeExports.jsx(nj,{ref:a,highlight:e,isAuditScoreLoading:x,onClick:()=>!x&&i(),children:o.jsxRuntimeExports.jsxs(sj,{auditPercentage:m.bypassedAuditScore,children:[o.jsxRuntimeExports.jsxs(rj,{children:[x?o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Standard",start:x}):o.jsxRuntimeExports.jsx(ij,{children:o.jsxRuntimeExports.jsx(o.CircularProgressbar,{value:m.bypassedAuditScore,text:`${Math.ceil(m.bypassedAuditScore)}%`,strokeWidth:10,styles:o.buildStyles({rotation:.5,strokeLinecap:"butt",pathColor:h,textColor:g.colors.primary,trailColor:g.colors.grey3,textSize:t.Space.sp4})})}),o.jsxRuntimeExports.jsx(aj,{children:o.jsxRuntimeExports.jsxs(lj,{children:[o.jsxRuntimeExports.jsxs(cj,{children:[o.jsxRuntimeExports.jsx(dj,{children:x?d.monthEndReport.auditScoreSectionLoadingTitle.replace("__date__",J.dateNow().subtract(1,"month").format(c.MMMMYYYYFormat)):d.monthEndReport.auditScoreSectionTitle}),x?null:o.jsxRuntimeExports.jsx(pj,{children:m.fixesRequired>0?`${l.strings.openingBrace}${m.fixesRequired} ${m.fixesRequired>1?l.texts.issues:l.texts.issue}${l.strings.closingBrace}`:l.strings.empty})]}),o.jsxRuntimeExports.jsx(uj,{children:o.jsxRuntimeExports.jsx(mj,{children:x?d.review.auditReportDrawer.subTitle:d.monthEndReport.auditScoreSectionSubtitle})})]})})]}),x?null:o.jsxRuntimeExports.jsx(xj,{windowSize:p,children:o.jsxRuntimeExports.jsx(hj,{width:t.Space.sp4,height:t.Space.sp4})})]})})});ga.displayName="MonthEndReportAuditSummarySection";const gj=[...J.SUPPORTED_ATTACHMENT_FILE_TYPES],Sj=7*1024*100,yj=s.div`
|
|
4460
4460
|
width: ${t.FORM_MINIMUM_WIDTH}px;
|
|
4461
4461
|
margin: ${t.Space.sp4} ${t.Space.sp0};
|
|
4462
4462
|
`,fj=s.div`
|
|
@@ -4557,7 +4557,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
4557
4557
|
z-index: ${t.sp[2]};
|
|
4558
4558
|
min-width: ${t.COMMENTS_SECTION_MINIMUM_WIDTH}px;
|
|
4559
4559
|
max-width: ${t.COMMENTS_DRAWER_MAXIMUM_WIDTH}px;
|
|
4560
|
-
`,Jt="monthEndReportFormSection",Qr="monthEndReportPage",Fe=t.appLocale.getLocalizedStrings();function Aj({companyId:e,enableZeniGPTFeature:n,enableSendingMonthEndEmail:r,monthEndReportView:i,previewMode:a,customerRequestData:d,allThreadsSectionOpen:l,filterMetaData:c,newThreadMetadata:p,isAuditScoreLoadingCompleted:m,improveUsingZeniGPTClick:x,onRemoveFileAttachment:S,onUpdateFileAttachment:h,onCloseAllThreadsSection:C,previewMonthEndReport:b,saveMonthEndReport:f,onEditClick:g,onOpenFileAttachmentSnackBar:j,onClickAuditScore:y,onClickCustomerRequest:E,sendMonthEndReport:R}){const I=o.useTheme(),[A,v]=u.useState(),[T,F]=u.useState(0),[D,K]=u.useState(0),M=u.useRef(),Y=u.useRef(null),G=u.useRef(null),w=u.useRef(null),{html:P,subject:B,improveUsingZeniGPTStatus:k}=i,[O,z]=u.useState(),[Z,ie]=u.useState(!1),[N,H]=u.useState(!1),[L,Q]=u.useState(!1),[se,X]=u.useState(!1),re=u.useRef(null),te=u.useRef(null),he=t.useDelayUnmount(l,250),fe=i.fetchState==="Not-Started"||i.fetchState==="In-Progress"||i.companyMonthEndReportTemplatesData.fetchState==="Not-Started"||i.companyMonthEndReportTemplatesData.fetchState==="In-Progress",{threadsRefs:be,sortedThreads:W,threadsPositions:ee,observer:ge,unresolvedThreadsMap:ve,handleRemoveFloatingThread:Re}=t.useFloatingThreads(c,re,!a,fe),[$,Ce]=u.useState(0),ae=u.useCallback(()=>{const Ye=be.current?.[be.current?.length-1];Ce(window.scrollY+(Ye?.getBoundingClientRect()?.bottom??0))},[be]),ce=u.useCallback(()=>{l?K(Math.min((window.innerWidth-t.FORM_MINIMUM_WIDTH)/2,window.innerWidth-t.FORM_MINIMUM_WIDTH-t.COMMENTS_DRAWER_MAXIMUM_WIDTH-t.sp[4])):F(Math.min((window.innerWidth-t.FORM_MINIMUM_WIDTH)/2,window.innerWidth-t.FORM_MINIMUM_WIDTH-t.COMMENTS_SECTION_MINIMUM_WIDTH))},[l]);u.useEffect(()=>{ce()},[l,ce]),u.useEffect(()=>(window.addEventListener("resize",ce),()=>{window.removeEventListener("resize",ce)}),[ce]),u.useEffect(()=>(window.addEventListener("scroll",ae),()=>window.removeEventListener("scroll",ae)),[ae]);const{openThread:$e,addThread:V,setOpenThread:_}=u.useContext(t.ThreadsContext),pe=t.useHandleSelection(t.MONTH_END_REPORT_CANVAS,!1,!a),ye=re.current?.getBoundingClientRect(),ke=pe!=null&&pe.coords&&ye?{left:pe.coords.left-ye.left,top:pe.coords.top-ye.top}:void 0,ue=u.useCallback(()=>{const Ye=window.getSelection()?.getRangeAt(0),ze=t.getSelectionData();if(!Ye||ze==null)return;const Je={...p,...ze,startPath:ze.startPath.join(),endPath:ze.endPath.join()},et=`${o.nanoid()}${t.NEW_THREAD_SUFFIX}`,wt=`cockpit_${e}`;V(et,{type:"thread",id:et,roomId:wt,createdAt:new Date,updatedAt:new Date,comments:[],metadata:Je,resolved:!1}),_(et)},[V,e,p,_]),U=()=>{Q(!0),setTimeout(()=>{Q(!1)},2e3)};u.useEffect(()=>{$e!=null&&l&&C()},[l,$e,C]);const Oe=k.fetchState==="In-Progress",Pe=o.useForm({mode:"all",defaultValues:Jr(i),values:Jr(i)}),Be=Pe.handleSubmit(Ye=>{const{recipientEmailList:ze,subject:Je}=Ye[Jt],et=i.auditSummaryData.auditSummary.bypassedAuditScore,wt=i.auditSummaryData.isControllerOrReviewer;if(a===!0)et>=75?R?.(O?.id):et<75&&(wt||r)&&X(!0);else if(et>=75||et<75&&(wt||r)){const so=A?.replace(t.EMPTY_HTML_CHECKER,Fe.common.strings.empty);ze!=null&&Je!=null&&b(ze,Je,O?.id,so!=null&&so.length>0?A:void 0)}else Ge()}),me=()=>{Y.current!=null&&Y.current.click()},q=()=>{O!==void 0&&O!=null&&(S([O.id]),z(void 0),ie(!1))},Ne=Ye=>{const ze=Ye.target.files?Ye.target.files[0]:null;if(ze)if(!J.toSupportedAttachmentFileType(ze.type)||N)console.warn("Please select a valid file.");else{const Je=new FileReader;Je.onload=function(et){const wt=et.target?.result;if(typeof wt=="string"){const so={data:wt.split(",")[1],name:ze.name,id:J.getAttachmentFileIdByFileName(e,ze.name)};z(so),ie(!0),h([so])}},Je.readAsDataURL(ze)}},Qe=()=>{G.current&&G.current.scrollIntoView({behavior:"smooth"})},Ge=()=>{w.current&&(w.current.scrollIntoView({behavior:"smooth"}),U())},Et=()=>{const Ye=Pe.getValues(),{recipientEmailList:ze,subject:Je}=Ye[Jt];ze!=null&&Je!=null&&f(ze,Je,O?.id,A)};u.useEffect(()=>{v(i.zeniRequestsHtml)},[i.zeniRequestsHtml]),u.useEffect(()=>{M.current=O},[O]),u.useEffect(()=>{z(J.mapAttachmentFileToAttachmentFilePayload(i.attachmentFile)),ie(!1)},[i.attachmentFile]),u.useEffect(()=>{N&&j()},[N,j]);const no=J.dateNow().subtract(1,"month").format(Fe.dateFormat.visual.MMMMFormat),Ut=P!=null?P.split(t.MONTH_END_EDITOR_PLACEHOLDER):[],Ra=i.concatenatedHtml,$a=()=>i.lastDraftSavedDate!=null&&a===!1?o.jsxRuntimeExports.jsx(t.UserWithTimestamp,{time:i.lastDraftSavedDate,user:i.reportLastSavedByUser,timeStampLabel:Fe.cockpit.monthEndReport.timeStampLabel}):null,Ea={onOkClick:()=>{R?.(O?.id),X(!1),Pe.reset()},onCancelClick:()=>{g==null?X(!1):g(),X(!1)}};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(Cj,{ref:te,style:$>0?{height:$}:void 0,children:[o.jsxRuntimeExports.jsx(fj,{availableWidth:l?D:T}),o.jsxRuntimeExports.jsxs(yj,{children:[o.jsxRuntimeExports.jsx(o.FormProvider,{...Pe,children:o.jsxRuntimeExports.jsx("form",{id:ei(Qr),onSubmit:Be,children:o.jsxRuntimeExports.jsxs(Tj,{children:[o.jsxRuntimeExports.jsx(t.MonthEndReportSection,{sectionId:Jt,previewMode:a,subject:B}),a?null:o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(ga,{ref:w,highlight:L,onClickAuditScore:y,auditSummaryData:i.auditSummaryData,isAuditScoreLoadingCompleted:m}),o.jsxRuntimeExports.jsx(t.MonthEndReportCustomerRequestSection,{totalItems:(i.zeniRequestsData??[]).length+t.getTemplatesFromTemplatedData(i.companyMonthEndReportTemplatesData).length,onClickCustomerRequest:E})]}),o.jsxRuntimeExports.jsxs(Rj,{id:t.MONTH_END_REPORT_CANVAS,ref:re,children:[o.jsxRuntimeExports.jsxs($j,{className:"monthEndReportCanvasWrapper",children:[O!=null||N?o.jsxRuntimeExports.jsx(Ej,{onClick:Qe,children:o.jsxRuntimeExports.jsx(t.CircleWithAttachmentSuccessIcon,{fileSizeError:N,setFileSizeError:H,loading:!1,showAnimation:!a&&Z})}):null,a?o.jsxRuntimeExports.jsx(qr,{dangerouslySetInnerHTML:{__html:t.getHTMLWithCommentingSections(Ra)}}):o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(bj,{id:t.MONTH_END_EMAIL_HEADER_SECTION,children:[o.jsxRuntimeExports.jsx(t.StandardRegular,{dangerouslySetInnerHTML:{__html:Ut[0]!=null?Ut[0]+"</body></html>":Fe.common.strings.empty}}),o.jsxRuntimeExports.jsxs(jj,{children:[o.jsxRuntimeExports.jsx(kj,{children:Fe.cockpit.monthEndReport.editorTitle}),o.jsxRuntimeExports.jsx(vj,{children:Fe.cockpit.monthEndReport.editorNote})]})]}),o.jsxRuntimeExports.jsx(wj,{id:t.MONTH_END_EMAIL_EDITOR_SECTION,children:o.jsxRuntimeExports.jsx(t.Editor,{handleFileInputClick:me,fileAttached:O!=null,enableZeniGPTFeature:n,isZeniGPTResponseLoading:Oe,initialHtmlString:i.zeniRequestsHtml,improveUsingZeniGPTClick:x,setZeniRequestsHtml:v,customerRequestData:d})}),o.jsxRuntimeExports.jsx(qr,{id:t.MONTH_END_EMAIL_BODY_SECTION,dangerouslySetInnerHTML:{__html:Ut[1]!=null?"<html><body>"+Ut[1]:Fe.common.strings.empty}})]}),O!=null?o.jsxRuntimeExports.jsx(t.FileAttachment,{ref:G,fileName:O.name,fileSize:t.base64FileSize(O.data),onRemove:q,isRemovable:!a}):null]}),ke?o.jsxRuntimeExports.jsx(t.AddThreadFloating,{style:{zIndex:15},coords:ke,alignment:pe.alignment,onClick:ue}):null,o.jsxRuntimeExports.jsx(t.TextHighlightSection,{canvasContainerRef:re,sortedThreads:W,editorMode:!a})]})]})})}),o.jsxRuntimeExports.jsx(t.FileInputElement,{name:O?.name??Fe.common.strings.empty,fileRef:Y,sizeLimit:Sj,acceptableTypes:gj,onFileChange:async Ye=>{Ne(Ye)},onFileSizeError:Ye=>H(Ye),multiple:!1})]}),he?o.jsxRuntimeExports.jsx(Ij,{allThreadsSectionOpen:l,children:o.jsxRuntimeExports.jsx(t.AllThreadsSection,{autoExpand:!0,autoFocus:!1,style:{borderLeft:`1px solid ${I.colors.grey3}`,boxShadow:`${t.Space.sp0} 1px 2px ${t.Space.sp0} ${t.Colors.boxShadowElevation}`},drawerSectionStyle:{width:`calc(100% - ${t.Space.sp5} - ${t.Space.sp5})`,backgroundColor:I.colors.background},threadsContainerStyle:{paddingBottom:a?"160px":t.Space.sp12},collapsibleThreadStyle:{width:`calc(100% - ${t.Space.sp4})`},allowComposer:!1,drawerTitle:Fe.common.texts.comments,filter:c,textOverrides:{},preventResolvedThreadClick:!0,onThreadClick:(Ye,ze)=>{_(ze);const Je=W.findIndex(et=>et[0]===ze);C(),be.current?.[Je]?.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},onCloseAllThreadsDrawer:()=>C()})}):o.jsxRuntimeExports.jsx(t.FloatingThreads,{observer:ge,canvasContainerRef:re,sortedThreads:W,threadsPositions:ee,threadsRefs:be,unresolvedThreadsMap:ve,editorMode:!a,style:{minWidth:`${t.COMMENTS_SECTION_MINIMUM_WIDTH}px`,position:"relative",height:"fit-content",width:"auto",top:`${re.current?.offsetTop}px`},handleRemoveFloatingThread:Re})]}),se?o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{children:Fe.cockpit.monthEndReport.sendMonthInsightsTitle.replace("__month__",no)}),descriptionComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:Fe.cockpit.monthEndReport.sendMonthInsightsDescription.replace("__month__",no)}),primaryButtonText:Fe.cockpit.monthEndReport.sendAnyway,primaryButtonWidth:124,secondaryButtonWidth:124,proceedButtonVariant:"destructive",secondaryButtonText:Fe.cockpit.monthEndReport.editButtonLabel,action:Ea,containerStyle:{minWidth:356}}):null,o.jsxRuntimeExports.jsx(t.Footer,{style:{zIndex:10},leftSideComponent:$a(),formId:ei(Qr),helperText:a===!0?Fe.cockpit.monthEndReport.reportSentDateInfo:void 0,cancelBtn:{isDisabled:!m||Oe,label:a===!0?Fe.cockpit.monthEndReport.editButtonLabel:Fe.cockpit.monthEndReport.saveChanges,onClick:a===!0?g:Et,style:{width:"225px"},size:"medium",isLoading:i.saveMonthEndReportStatus.fetchState==="In-Progress",reverseSpinnerColor:!1},primaryBtn:{isDisabled:!m||Oe,isLoading:a===!0?i.sendMonthEndReportStatus.fetchState==="In-Progress":i.previewMonthEndReportStatus.fetchState==="In-Progress",style:{width:a===!0?"unset":"225px"},label:a===!0?Fe.cockpit.monthEndReport.sendEmailButtonLabel.replace("__month__",no):Fe.cockpit.monthEndReport.preview,size:"medium"}})]})}const Jr=e=>({[Jt]:{recipientEmailList:e.recipientEmailList,subject:e.subject??Fe.common.strings.empty}}),ei=e=>`${e}_form`,Dj=s(t.SmallRegular)`
|
|
4560
|
+
`,Jt="monthEndReportFormSection",Qr="monthEndReportPage",Fe=t.appLocale.getLocalizedStrings();function Aj({companyId:e,enableZeniGPTFeature:n,enableSendingMonthEndEmail:r,monthEndReportView:i,previewMode:a,customerRequestData:d,allThreadsSectionOpen:l,filterMetaData:c,newThreadMetadata:p,isAuditScoreLoadingCompleted:m,improveUsingZeniGPTClick:x,onRemoveFileAttachment:g,onUpdateFileAttachment:h,onCloseAllThreadsSection:j,previewMonthEndReport:b,saveMonthEndReport:C,onEditClick:S,onOpenFileAttachmentSnackBar:y,onClickAuditScore:f,onClickCustomerRequest:E,sendMonthEndReport:R}){const I=o.useTheme(),[A,v]=u.useState(),[T,F]=u.useState(0),[D,K]=u.useState(0),M=u.useRef(),Y=u.useRef(null),G=u.useRef(null),w=u.useRef(null),{html:P,subject:B,improveUsingZeniGPTStatus:k}=i,[O,z]=u.useState(),[Z,ie]=u.useState(!1),[N,H]=u.useState(!1),[L,Q]=u.useState(!1),[se,X]=u.useState(!1),re=u.useRef(null),te=u.useRef(null),he=t.useDelayUnmount(l,250),fe=i.fetchState==="Not-Started"||i.fetchState==="In-Progress"||i.companyMonthEndReportTemplatesData.fetchState==="Not-Started"||i.companyMonthEndReportTemplatesData.fetchState==="In-Progress",{threadsRefs:be,sortedThreads:W,threadsPositions:ee,observer:ge,unresolvedThreadsMap:ve,handleRemoveFloatingThread:Re}=t.useFloatingThreads(c,re,!a,fe),[$,Ce]=u.useState(0),ae=u.useCallback(()=>{const Ye=be.current?.[be.current?.length-1];Ce(window.scrollY+(Ye?.getBoundingClientRect()?.bottom??0))},[be]),ce=u.useCallback(()=>{l?K(Math.min((window.innerWidth-t.FORM_MINIMUM_WIDTH)/2,window.innerWidth-t.FORM_MINIMUM_WIDTH-t.COMMENTS_DRAWER_MAXIMUM_WIDTH-t.sp[4])):F(Math.min((window.innerWidth-t.FORM_MINIMUM_WIDTH)/2,window.innerWidth-t.FORM_MINIMUM_WIDTH-t.COMMENTS_SECTION_MINIMUM_WIDTH))},[l]);u.useEffect(()=>{ce()},[l,ce]),u.useEffect(()=>(window.addEventListener("resize",ce),()=>{window.removeEventListener("resize",ce)}),[ce]),u.useEffect(()=>(window.addEventListener("scroll",ae),()=>window.removeEventListener("scroll",ae)),[ae]);const{openThread:$e,addThread:V,setOpenThread:_}=u.useContext(t.ThreadsContext),pe=t.useHandleSelection(t.MONTH_END_REPORT_CANVAS,!1,!a),ye=re.current?.getBoundingClientRect(),ke=pe!=null&&pe.coords&&ye?{left:pe.coords.left-ye.left,top:pe.coords.top-ye.top}:void 0,ue=u.useCallback(()=>{const Ye=window.getSelection()?.getRangeAt(0),ze=t.getSelectionData();if(!Ye||ze==null)return;const Je={...p,...ze,startPath:ze.startPath.join(),endPath:ze.endPath.join()},et=`${o.nanoid()}${t.NEW_THREAD_SUFFIX}`,wt=`cockpit_${e}`;V(et,{type:"thread",id:et,roomId:wt,createdAt:new Date,updatedAt:new Date,comments:[],metadata:Je,resolved:!1}),_(et)},[V,e,p,_]),U=()=>{Q(!0),setTimeout(()=>{Q(!1)},2e3)};u.useEffect(()=>{$e!=null&&l&&j()},[l,$e,j]);const Oe=k.fetchState==="In-Progress",Pe=o.useForm({mode:"all",defaultValues:Jr(i),values:Jr(i)}),Be=Pe.handleSubmit(Ye=>{const{recipientEmailList:ze,subject:Je}=Ye[Jt],et=i.auditSummaryData.auditSummary.bypassedAuditScore,wt=i.auditSummaryData.isControllerOrReviewer;if(a===!0)et>=75?R?.(O?.id):et<75&&(wt||r)&&X(!0);else if(et>=75||et<75&&(wt||r)){const so=A?.replace(t.EMPTY_HTML_CHECKER,Fe.common.strings.empty);ze!=null&&Je!=null&&b(ze,Je,O?.id,so!=null&&so.length>0?A:void 0)}else Ge()}),me=()=>{Y.current!=null&&Y.current.click()},q=()=>{O!==void 0&&O!=null&&(g([O.id]),z(void 0),ie(!1))},Ne=Ye=>{const ze=Ye.target.files?Ye.target.files[0]:null;if(ze)if(!J.toSupportedAttachmentFileType(ze.type)||N)console.warn("Please select a valid file.");else{const Je=new FileReader;Je.onload=function(et){const wt=et.target?.result;if(typeof wt=="string"){const so={data:wt.split(",")[1],name:ze.name,id:J.getAttachmentFileIdByFileName(e,ze.name)};z(so),ie(!0),h([so])}},Je.readAsDataURL(ze)}},Qe=()=>{G.current&&G.current.scrollIntoView({behavior:"smooth"})},Ge=()=>{w.current&&(w.current.scrollIntoView({behavior:"smooth"}),U())},Et=()=>{const Ye=Pe.getValues(),{recipientEmailList:ze,subject:Je}=Ye[Jt];ze!=null&&Je!=null&&C(ze,Je,O?.id,A)};u.useEffect(()=>{v(i.zeniRequestsHtml)},[i.zeniRequestsHtml]),u.useEffect(()=>{M.current=O},[O]),u.useEffect(()=>{z(J.mapAttachmentFileToAttachmentFilePayload(i.attachmentFile)),ie(!1)},[i.attachmentFile]),u.useEffect(()=>{N&&y()},[N,y]);const no=J.dateNow().subtract(1,"month").format(Fe.dateFormat.visual.MMMMFormat),Ut=P!=null?P.split(t.MONTH_END_EDITOR_PLACEHOLDER):[],Ra=i.concatenatedHtml,$a=()=>i.lastDraftSavedDate!=null&&a===!1?o.jsxRuntimeExports.jsx(t.UserWithTimestamp,{time:i.lastDraftSavedDate,user:i.reportLastSavedByUser,timeStampLabel:Fe.cockpit.monthEndReport.timeStampLabel}):null,Ea={onOkClick:()=>{R?.(O?.id),X(!1),Pe.reset()},onCancelClick:()=>{S==null?X(!1):S(),X(!1)}};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(Cj,{ref:te,style:$>0?{height:$}:void 0,children:[o.jsxRuntimeExports.jsx(fj,{availableWidth:l?D:T}),o.jsxRuntimeExports.jsxs(yj,{children:[o.jsxRuntimeExports.jsx(o.FormProvider,{...Pe,children:o.jsxRuntimeExports.jsx("form",{id:ei(Qr),onSubmit:Be,children:o.jsxRuntimeExports.jsxs(Tj,{children:[o.jsxRuntimeExports.jsx(t.MonthEndReportSection,{sectionId:Jt,previewMode:a,subject:B}),a?null:o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(ga,{ref:w,highlight:L,onClickAuditScore:f,auditSummaryData:i.auditSummaryData,isAuditScoreLoadingCompleted:m}),o.jsxRuntimeExports.jsx(t.MonthEndReportCustomerRequestSection,{totalItems:(i.zeniRequestsData??[]).length+t.getTemplatesFromTemplatedData(i.companyMonthEndReportTemplatesData).length,onClickCustomerRequest:E})]}),o.jsxRuntimeExports.jsxs(Rj,{id:t.MONTH_END_REPORT_CANVAS,ref:re,children:[o.jsxRuntimeExports.jsxs($j,{className:"monthEndReportCanvasWrapper",children:[O!=null||N?o.jsxRuntimeExports.jsx(Ej,{onClick:Qe,children:o.jsxRuntimeExports.jsx(t.CircleWithAttachmentSuccessIcon,{fileSizeError:N,setFileSizeError:H,loading:!1,showAnimation:!a&&Z})}):null,a?o.jsxRuntimeExports.jsx(qr,{dangerouslySetInnerHTML:{__html:t.getHTMLWithCommentingSections(Ra)}}):o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(bj,{id:t.MONTH_END_EMAIL_HEADER_SECTION,children:[o.jsxRuntimeExports.jsx(t.StandardRegular,{dangerouslySetInnerHTML:{__html:Ut[0]!=null?Ut[0]+"</body></html>":Fe.common.strings.empty}}),o.jsxRuntimeExports.jsxs(jj,{children:[o.jsxRuntimeExports.jsx(kj,{children:Fe.cockpit.monthEndReport.editorTitle}),o.jsxRuntimeExports.jsx(vj,{children:Fe.cockpit.monthEndReport.editorNote})]})]}),o.jsxRuntimeExports.jsx(wj,{id:t.MONTH_END_EMAIL_EDITOR_SECTION,children:o.jsxRuntimeExports.jsx(t.Editor,{handleFileInputClick:me,fileAttached:O!=null,enableZeniGPTFeature:n,isZeniGPTResponseLoading:Oe,initialHtmlString:i.zeniRequestsHtml,improveUsingZeniGPTClick:x,setZeniRequestsHtml:v,customerRequestData:d})}),o.jsxRuntimeExports.jsx(qr,{id:t.MONTH_END_EMAIL_BODY_SECTION,dangerouslySetInnerHTML:{__html:Ut[1]!=null?"<html><body>"+Ut[1]:Fe.common.strings.empty}})]}),O!=null?o.jsxRuntimeExports.jsx(t.FileAttachment,{ref:G,fileName:O.name,fileSize:t.base64FileSize(O.data),onRemove:q,isRemovable:!a}):null]}),ke?o.jsxRuntimeExports.jsx(t.AddThreadFloating,{style:{zIndex:15},coords:ke,alignment:pe.alignment,onClick:ue}):null,o.jsxRuntimeExports.jsx(t.TextHighlightSection,{canvasContainerRef:re,sortedThreads:W,editorMode:!a})]})]})})}),o.jsxRuntimeExports.jsx(t.FileInputElement,{name:O?.name??Fe.common.strings.empty,fileRef:Y,sizeLimit:Sj,acceptableTypes:gj,onFileChange:async Ye=>{Ne(Ye)},onFileSizeError:Ye=>H(Ye),multiple:!1})]}),he?o.jsxRuntimeExports.jsx(Ij,{allThreadsSectionOpen:l,children:o.jsxRuntimeExports.jsx(t.AllThreadsSection,{autoExpand:!0,autoFocus:!1,style:{borderLeft:`1px solid ${I.colors.grey3}`,boxShadow:`${t.Space.sp0} 1px 2px ${t.Space.sp0} ${t.Colors.boxShadowElevation}`},drawerSectionStyle:{width:`calc(100% - ${t.Space.sp5} - ${t.Space.sp5})`,backgroundColor:I.colors.background},threadsContainerStyle:{paddingBottom:a?"160px":t.Space.sp12},collapsibleThreadStyle:{width:`calc(100% - ${t.Space.sp4})`},allowComposer:!1,drawerTitle:Fe.common.texts.comments,filter:c,textOverrides:{},preventResolvedThreadClick:!0,onThreadClick:(Ye,ze)=>{_(ze);const Je=W.findIndex(et=>et[0]===ze);j(),be.current?.[Je]?.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},onCloseAllThreadsDrawer:()=>j()})}):o.jsxRuntimeExports.jsx(t.FloatingThreads,{observer:ge,canvasContainerRef:re,sortedThreads:W,threadsPositions:ee,threadsRefs:be,unresolvedThreadsMap:ve,editorMode:!a,style:{minWidth:`${t.COMMENTS_SECTION_MINIMUM_WIDTH}px`,position:"relative",height:"fit-content",width:"auto",top:`${re.current?.offsetTop}px`},handleRemoveFloatingThread:Re})]}),se?o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{children:Fe.cockpit.monthEndReport.sendMonthInsightsTitle.replace("__month__",no)}),descriptionComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:Fe.cockpit.monthEndReport.sendMonthInsightsDescription.replace("__month__",no)}),primaryButtonText:Fe.cockpit.monthEndReport.sendAnyway,primaryButtonWidth:124,secondaryButtonWidth:124,proceedButtonVariant:"destructive",secondaryButtonText:Fe.cockpit.monthEndReport.editButtonLabel,action:Ea,containerStyle:{minWidth:356}}):null,o.jsxRuntimeExports.jsx(t.Footer,{style:{zIndex:10},leftSideComponent:$a(),formId:ei(Qr),helperText:a===!0?Fe.cockpit.monthEndReport.reportSentDateInfo:void 0,cancelBtn:{isDisabled:!m||Oe,label:a===!0?Fe.cockpit.monthEndReport.editButtonLabel:Fe.cockpit.monthEndReport.saveChanges,onClick:a===!0?S:Et,style:{width:"225px"},size:"medium",isLoading:i.saveMonthEndReportStatus.fetchState==="In-Progress",reverseSpinnerColor:!1},primaryBtn:{isDisabled:!m||Oe,isLoading:a===!0?i.sendMonthEndReportStatus.fetchState==="In-Progress":i.previewMonthEndReportStatus.fetchState==="In-Progress",style:{width:a===!0?"unset":"225px"},label:a===!0?Fe.cockpit.monthEndReport.sendEmailButtonLabel.replace("__month__",no):Fe.cockpit.monthEndReport.preview,size:"medium"}})]})}const Jr=e=>({[Jt]:{recipientEmailList:e.recipientEmailList,subject:e.subject??Fe.common.strings.empty}}),ei=e=>`${e}_form`,Dj=s(t.SmallRegular)`
|
|
4561
4561
|
color: ${e=>e.theme.colors.hero};
|
|
4562
4562
|
display: flex;
|
|
4563
4563
|
align-items: center;
|
|
@@ -4655,7 +4655,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
4655
4655
|
`,Yj=s(t.SvgReload)`
|
|
4656
4656
|
width: ${t.Space.sp10};
|
|
4657
4657
|
height: ${t.Space.sp10};
|
|
4658
|
-
`,{dateFormat:Zj,card:Xj,cockpit:qj}=t.appLocale.getLocalizedStrings(),ti=({message:e,onReload:n})=>o.jsxRuntimeExports.jsxs(Gj,{onClick:n,children:[o.jsxRuntimeExports.jsx(Yj,{}),o.jsxRuntimeExports.jsx(Kj,{children:e})]}),Qj=e=>{const{monthEndReportView:n,companyId:r,previewMode:i,onRefresh:a,onNavigateBack:d}=e,{openThread:l,setOpenThread:c}=u.useContext(t.ThreadsContext),p=J.dateNow().subtract(1,"month").format(Zj.visual.MMSlashYYYYFormat),[m,x]=u.useState(!1);if(n.fetchState==="Not-Started"||n.fetchState==="In-Progress"||n.companyMonthEndReportTemplatesData.fetchState==="Not-Started"||n.companyMonthEndReportTemplatesData.fetchState==="In-Progress")return o.jsxRuntimeExports.jsx(nn,{children:o.jsxRuntimeExports.jsx(Hj,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})})});if(n.fetchState==="Error"||n.companyMonthEndReportTemplatesData.fetchState==="Error")return o.jsxRuntimeExports.jsx(nn,{children:o.jsxRuntimeExports.jsx(ti,{onReload:a,message:Xj.failedText})});if(n.html==null)return o.jsxRuntimeExports.jsx(nn,{children:o.jsxRuntimeExports.jsx(ti,{onReload:a,message:qj.monthEndReport.insightsNotAvailable})});const
|
|
4658
|
+
`,{dateFormat:Zj,card:Xj,cockpit:qj}=t.appLocale.getLocalizedStrings(),ti=({message:e,onReload:n})=>o.jsxRuntimeExports.jsxs(Gj,{onClick:n,children:[o.jsxRuntimeExports.jsx(Yj,{}),o.jsxRuntimeExports.jsx(Kj,{children:e})]}),Qj=e=>{const{monthEndReportView:n,companyId:r,previewMode:i,onRefresh:a,onNavigateBack:d}=e,{openThread:l,setOpenThread:c}=u.useContext(t.ThreadsContext),p=J.dateNow().subtract(1,"month").format(Zj.visual.MMSlashYYYYFormat),[m,x]=u.useState(!1);if(n.fetchState==="Not-Started"||n.fetchState==="In-Progress"||n.companyMonthEndReportTemplatesData.fetchState==="Not-Started"||n.companyMonthEndReportTemplatesData.fetchState==="In-Progress")return o.jsxRuntimeExports.jsx(nn,{children:o.jsxRuntimeExports.jsx(Hj,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})})});if(n.fetchState==="Error"||n.companyMonthEndReportTemplatesData.fetchState==="Error")return o.jsxRuntimeExports.jsx(nn,{children:o.jsxRuntimeExports.jsx(ti,{onReload:a,message:Xj.failedText})});if(n.html==null)return o.jsxRuntimeExports.jsx(nn,{children:o.jsxRuntimeExports.jsx(ti,{onReload:a,message:qj.monthEndReport.insightsNotAvailable})});const g={application:"cockpit",companyId:r,entityId:r,tab:"management",isGlobalComment:!1,entityType:"management.monthEndEmail",companyName:n.companyName,url:window.location.href,selectedRange:p},{url:h,...j}=g,b={...j},C=`cockpit_${r}`;return o.jsxRuntimeExports.jsx(Xe.RoomProvider,{id:C,children:o.jsxRuntimeExports.jsxs(nn,{children:[o.jsxRuntimeExports.jsx(Sa,{companyName:n.companyName,threadMetadata:b,onAllThreadsClick:()=>{l!=null&&c(null),x(!0)},onNavigateBack:d,onRefresh:a}),o.jsxRuntimeExports.jsx(Aj,{...e,allThreadsSectionOpen:m,filterMetaData:b,newThreadMetadata:g,onCloseAllThreadsSection:()=>x(!1)},i.toString())]})})},Qn=s.div`
|
|
4659
4659
|
display: flex;
|
|
4660
4660
|
justify-content: flex-end;
|
|
4661
4661
|
align-items: center;
|
|
@@ -4778,7 +4778,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
4778
4778
|
padding-bottom: ${t.Space.sp5};
|
|
4779
4779
|
`,u3=s(t.ExtraSmallRegular)`
|
|
4780
4780
|
color: ${e=>e.theme.colors.grey1};
|
|
4781
|
-
`,{common:{strings:sn,datePicker:m3,texts:x3},dateFormat:rn,cockpit:h3,card:g3}=t.appLocale.getLocalizedStrings(),S3=({historicData:e,companyId:n,newThreadMetadata:r,containerRef:i,sortedThreads:a})=>{const{addThread:d,setOpenThread:l}=u.useContext(t.ThreadsContext),c=u.useRef(null),[p,m]=u.useState(),[x,S]=u.useState(!1),h="monthEndReportHistoricDataPage",C=t.useHandleSelection(t.MONTH_END_REPORT_CANVAS,!1,!1),b=i.current?.getBoundingClientRect(),f=C!=null&&C.coords!=null&&b?{left:C.coords.left-b.left,top:C.coords.top-b.top}:void 0,g=o.useForm({mode:"all",defaultValues:oi(e),values:oi(e)}),j=()=>{c.current&&c.current.scrollIntoView({behavior:"smooth"})};u.useEffect(()=>{m(J.mapAttachmentFileToAttachmentFilePayload(e.attachmentFile))},[e.attachmentFile]);const y=u.useCallback(()=>{const E=window.getSelection()?.getRangeAt(0),R=t.getSelectionData();if(!E||R==null)return;const I={...r,...R,startPath:R.startPath.join(),endPath:R.endPath.join()},A=`${o.nanoid()}${t.NEW_THREAD_SUFFIX}`,v=`cockpit_${n}`;d(A,{type:"thread",id:A,roomId:v,createdAt:new Date,updatedAt:new Date,comments:[],metadata:I,resolved:!1}),l(A)},[d,n,r,l]);return o.jsxRuntimeExports.jsx(o.FormProvider,{...g,children:o.jsxRuntimeExports.jsx("form",{id:f3(h),children:o.jsxRuntimeExports.jsxs(c3,{children:[o.jsxRuntimeExports.jsx(t.MonthEndReportSection,{previewMode:!0,subject:e.subject,sectionId:Jt}),o.jsxRuntimeExports.jsxs(Jj,{id:t.MONTH_END_REPORT_CANVAS,ref:i,children:[o.jsxRuntimeExports.jsxs(e3,{className:"monthEndReportCanvasWrapper",children:[p!=null?o.jsxRuntimeExports.jsx(t3,{onClick:j,children:o.jsxRuntimeExports.jsx(t.CircleWithAttachmentSuccessIcon,{loading:!1,fileSizeError:x,setFileSizeError:S})}):null,o.jsxRuntimeExports.jsx(t.StandardRegular,{style:{position:"relative"},dangerouslySetInnerHTML:{__html:t.getHTMLWithCommentingSections(e.concatenatedHtml)}}),p!=null?o.jsxRuntimeExports.jsx(t.FileAttachment,{ref:c,fileName:p.name,fileSize:t.base64FileSize(p.data),isRemovable:!1}):null]}),f?o.jsxRuntimeExports.jsx(t.AddThreadFloating,{style:{zIndex:15},coords:f,alignment:C.alignment,onClick:y}):null,o.jsxRuntimeExports.jsx(t.TextHighlightSection,{canvasContainerRef:i,sortedThreads:a,editorMode:!1})]})]})})})},y3=e=>{const{monthEndReportHistoricData:n,reportSentDate:r,onRefresh:i,onNavigateBack:a,onDateChange:d}=e,l=o.useTheme(),[c,p]=u.useState(!1),[m,x]=u.useState(),S=u.useRef(null),[h,C]=u.useState(0),[b,f]=u.useState(0),g=t.useDelayUnmount(c,250),{data:j,companyId:y,companyName:E,firstMonthOfFY:R}=n,I=t.getMonthIndex(r.format(rn.visual.MMMMFormat)),A=Number(r.format(rn.visual.YYYYformat)),v=R>I?A-1:A;u.useEffect(()=>{const re=I>0?I-1:12;x(`${o.padStart(re.toString(),2,"0")}${sn.backspace}${A}`)},[]);const T={application:"cockpit",companyId:y,entityId:y,tab:"management",isGlobalComment:!1,entityType:"management.monthEndEmail",companyName:E,url:window.location.href,selectedRange:m},{url:F,...D}=T,K={...D},M=n.fetchState==="Not-Started"||n.fetchState==="In-Progress",{threadsRefs:Y,sortedThreads:G,threadsPositions:w,observer:P,unresolvedThreadsMap:B,handleRemoveFloatingThread:k}=t.useFloatingThreads(K,S,!1,M),O=u.useRef(null),[z,Z]=u.useState(0),ie=u.useCallback(()=>{const re=Y.current?.[Y.current?.length-1];Z(window.scrollY+(re?.getBoundingClientRect()?.bottom??0))},[Y]),N=u.useCallback(()=>{c?f(Math.min((window.innerWidth-t.FORM_MINIMUM_WIDTH)/2,window.innerWidth-t.FORM_MINIMUM_WIDTH-t.COMMENTS_DRAWER_MAXIMUM_WIDTH-t.sp[4])):C(Math.min((window.innerWidth-t.FORM_MINIMUM_WIDTH)/2,window.innerWidth-t.FORM_MINIMUM_WIDTH-t.COMMENTS_SECTION_MINIMUM_WIDTH))},[c]);u.useEffect(()=>{N()},[c,N]),u.useEffect(()=>(window.addEventListener("resize",N),()=>{window.removeEventListener("resize",N)}),[N]),u.useEffect(()=>(window.addEventListener("scroll",ie),()=>window.removeEventListener("scroll",ie)),[ie]);const{openThread:H,setOpenThread:L}=u.useContext(t.ThreadsContext);u.useEffect(()=>{H!=null&&c&&p(!1)},[c,H,p]);const Q=t.getHistoricMonthsList(R,n.historicReportSentDates),se=u.useCallback((re,te)=>{const he=R>re?te+1:te;d(J.dateFromYearMonthDate(he,re-1));const fe=re>0?re-1:12;x(`${o.padStart(fe.toString(),2,"0")}${sn.backspace}${he}`)},[R,d]);if(n.fetchState==="Not-Started"||n.fetchState==="In-Progress")return o.jsxRuntimeExports.jsxs(Jn,{children:[o.jsxRuntimeExports.jsx(Qn,{children:o.jsxRuntimeExports.jsx(es,{onClick:a})}),o.jsxRuntimeExports.jsx(t.BusyIndication,{fetchState:n.fetchState,styles:{margin:t.Space.sp0}})]});if(n.fetchState==="Error")return o.jsxRuntimeExports.jsxs(Jn,{children:[o.jsxRuntimeExports.jsx(Qn,{children:o.jsxRuntimeExports.jsx(es,{onClick:a})}),o.jsxRuntimeExports.jsx(t.ReloadContainer,{onReload:i,message:g3.failedText})]});if(j?.concatenatedHtml==null)return o.jsxRuntimeExports.jsxs(Jn,{children:[o.jsxRuntimeExports.jsx(Qn,{children:o.jsxRuntimeExports.jsx(es,{onClick:a})}),o.jsxRuntimeExports.jsx(t.ReloadContainer,{onReload:i,message:h3.monthEndReport.insightsNotAvailable})]});const X=`cockpit_${y}`;return o.jsxRuntimeExports.jsx(Xe.RoomProvider,{id:X,children:o.jsxRuntimeExports.jsxs(o3,{children:[o.jsxRuntimeExports.jsx(Sa,{companyName:n.companyName,onNavigateBack:a,monthCalendar:{monthAndYears:Q,label:`${r.format(rn.visual.MMMformat)} ${v}`,selectedMonth:{month:I,year:v},onChange:se},threadMetadata:K,onAllThreadsClick:()=>{H!=null&&L(null),p(!0)}}),o.jsxRuntimeExports.jsxs(a3,{ref:O,style:z>0?{height:z}:void 0,children:[o.jsxRuntimeExports.jsx(n3,{availableWidth:c?b:h}),o.jsxRuntimeExports.jsxs(l3,{children:[o.jsxRuntimeExports.jsx(S3,{historicData:j,newThreadMetadata:T,companyId:y,sortedThreads:G,containerRef:S}),o.jsxRuntimeExports.jsxs(p3,{children:[o.jsxRuntimeExports.jsx(wi,{user:n.reportLastSentByUser}),o.jsxRuntimeExports.jsx(d3,{}),o.jsxRuntimeExports.jsxs(u3,{children:[m3.businessDay,sn.space,n.data?.reportSentDate!=null?J.getBusinessDayOfDate(n.data.reportSentDate):null,":",sn.space,n.data?.reportSentDate?.format(rn.visual.MMMDFormat)]})]})]}),g?o.jsxRuntimeExports.jsx(i3,{allThreadsSectionOpen:c,children:o.jsxRuntimeExports.jsx(t.AllThreadsSection,{autoExpand:!0,autoFocus:!1,style:{borderLeft:`1px solid ${l.colors.grey3}`,boxShadow:`${t.Space.sp0} 1px 2px ${t.Space.sp0} ${t.Colors.boxShadowElevation}`},drawerSectionStyle:{width:`calc(100% - ${t.Space.sp5} - ${t.Space.sp5})`,backgroundColor:l.colors.background},threadsContainerStyle:{paddingBottom:t.Space.sp5},collapsibleThreadStyle:{width:`calc(100% - ${t.Space.sp4})`},allowComposer:!1,drawerTitle:x3.comments,filter:K,textOverrides:{},preventResolvedThreadClick:!0,onThreadClick:(re,te)=>{L(te);const he=G.findIndex(fe=>fe[0]===te);p(!1),Y.current?.[he]?.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},onCloseAllThreadsDrawer:()=>p(!1)})}):o.jsxRuntimeExports.jsx(t.FloatingThreads,{observer:P,canvasContainerRef:S,sortedThreads:G,threadsPositions:w,threadsRefs:Y,unresolvedThreadsMap:B,editorMode:!1,style:{minWidth:`${t.COMMENTS_SECTION_MINIMUM_WIDTH}px`,position:"relative",height:"fit-content",width:"auto",top:`${S.current?.offsetTop}px`},handleRemoveFloatingThread:k})]})]})})},oi=e=>({[Jt]:{recipientEmailList:e.recipientEmailList??[],subject:e.subject??""}}),f3=e=>`${e}_form`,C3=e=>le.createElement("svg",{width:98,height:121,viewBox:"0 0 98 121",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M49.2796 0.921875C32.9744 0.921875 19.7096 14.1944 19.7096 30.5087C19.7125 35.7639 21.1132 40.9238 23.7681 45.459C26.423 49.9943 30.2365 53.7418 34.8175 56.317C34.4083 56.561 33.9588 56.7299 33.4901 56.8156C26.6518 57.6437 22.4965 58.8342 19.5952 60.7958C16.8429 62.6568 15.2375 65.1511 14.0552 69.4056C14.0509 69.4209 14.0466 69.4363 14.0431 69.4518L10.0918 85.7362C9.51826 88.1132 9.82738 90.6176 10.9617 92.7837C12.0961 94.9499 13.9785 96.6304 16.2589 97.5129L20.1569 99.0144H10.7796C7.99797 99.0144 5.33033 100.119 3.36345 102.086C1.39658 104.053 0.291567 106.721 0.291504 109.502V110.435C0.291815 113.216 1.39693 115.884 3.36378 117.85C5.33063 119.817 7.99813 120.922 10.7796 120.922H53.2747C53.6551 120.922 54.0199 120.771 54.2889 120.502C54.5579 120.233 54.709 119.868 54.709 119.488C54.709 119.107 54.5579 118.742 54.2889 118.473C54.0199 118.204 53.6551 118.053 53.2747 118.053H34.0289C38.6739 116.234 43.0832 113.862 47.1618 110.989C59.9371 101.998 69.4844 101.883 69.5755 101.883H86.6115C88.6324 101.883 90.5704 102.686 91.9994 104.115C93.4283 105.544 94.2311 107.482 94.2311 109.502V110.435C94.2308 112.455 93.4279 114.393 91.999 115.822C90.5701 117.251 88.6322 118.053 86.6115 118.053H62.8365C62.4561 118.053 62.0913 118.204 61.8223 118.473C61.5533 118.742 61.4022 119.107 61.4022 119.488C61.4022 119.868 61.5533 120.233 61.8223 120.502C62.0913 120.771 62.4561 120.922 62.8365 120.922H86.6115C89.3932 120.922 92.0609 119.817 94.0278 117.85C95.9947 115.883 97.0996 113.215 97.0996 110.433V109.501C97.0996 106.72 95.9947 104.052 94.0278 102.085C92.0609 100.118 89.3932 99.013 86.6115 99.013H77.2552L81.1289 97.5124C83.4101 96.6305 85.2933 94.95 86.4283 92.7836C87.5633 90.6172 87.8728 88.1123 87.2993 85.7348L83.3471 69.4504C83.3435 69.4349 83.3393 69.42 83.335 69.4047C81.0779 61.2834 76.7211 58.4595 63.9108 56.8156C63.6617 56.7812 63.4178 56.7159 63.1848 56.6214C67.9202 54.1003 71.88 50.3378 74.6396 45.7373C77.3993 41.1368 78.8546 35.872 78.8496 30.5073C78.8496 14.1942 65.5848 0.921875 49.2796 0.921875ZM50.0808 3.84176C56.084 4.02211 61.8511 6.22111 66.4504 10.0835C71.0497 13.9459 74.2125 19.2461 75.4278 25.1278C76.6431 31.0094 75.84 37.1291 73.1483 42.498C70.4565 47.867 66.0332 52.1716 60.5931 54.7165C59.1024 53.1795 57.8049 51.1354 57.3184 49.7456C58.4778 48.8954 59.4906 47.8615 60.3167 46.6848C60.9625 46.9809 61.6621 47.1419 62.3724 47.1577C62.8095 47.1603 63.2432 47.0811 63.6512 46.9243C64.5464 46.5762 65.7044 45.6681 66.1373 43.3181C66.2624 42.9869 66.4272 42.6721 66.628 42.3806L66.7279 42.2148C68.7825 38.8099 69.2671 36.263 68.2103 34.43C67.7877 33.7064 67.1417 33.1394 66.3694 32.8142C66.4922 32.3725 66.5552 31.9163 66.5566 31.4579V29.7934C66.5566 24.4319 64.183 20.499 58.861 17.0401C58.612 16.8783 58.3989 16.667 58.235 16.4194C58.071 16.1718 57.9598 15.8931 57.9081 15.6007C57.125 11.0899 54.1033 8.50358 49.6158 8.50358H49.613C42.7338 8.50525 41.4374 13.4875 41.1983 15.6301C41.1628 15.9531 41.0576 16.2647 40.8901 16.5432C40.7227 16.8217 40.4968 17.0607 40.2282 17.2436C36.7881 19.5877 32.8393 23.1325 32.8393 29.7934V31.4579C32.8389 31.9742 32.9165 32.4876 33.0695 32.9808C32.4212 33.2864 31.8789 33.7785 31.5119 34.3941C30.4489 36.1843 30.9504 38.7427 33.0456 42.2153L33.133 42.36C33.3398 42.6607 33.5094 42.9854 33.6381 43.3269C33.9878 45.1621 34.9709 46.0635 35.7344 46.4966C36.4514 46.8873 37.2576 47.0851 38.074 47.0704C38.4264 47.0695 38.7782 47.0401 39.1259 46.9826C39.7172 47.7756 40.3958 48.4996 41.1489 49.141C40.3987 51.1167 38.8989 53.0103 37.368 54.4238C32.9251 52.2043 29.188 48.7913 26.5758 44.5673C23.9635 40.3432 22.5793 35.4752 22.5781 30.5087C22.5811 26.9366 23.3008 23.4015 24.6945 20.1126C26.0883 16.8237 28.1278 13.8479 30.6922 11.3613C33.2567 8.87477 36.294 6.92806 39.6244 5.63643C42.9547 4.34481 46.5104 3.73454 50.0808 3.84176V3.84176ZM49.6125 11.3716H49.6148C52.6985 11.3716 54.5375 12.9592 55.0811 16.0909C55.2008 16.7719 55.4592 17.4211 55.8404 17.998C56.2216 18.575 56.7174 19.0673 57.2969 19.4445C61.7759 22.3556 63.6871 25.4502 63.6871 29.793V31.4574C63.6872 31.8279 63.5967 32.1929 63.4235 32.5204C63.2502 32.8479 62.9995 33.1281 62.6931 33.3366V30.1506C62.6908 29.0631 62.4335 27.9912 61.9419 27.0212C61.4503 26.0511 60.7381 25.2098 59.8624 24.5648C57.1677 22.6285 53.7984 24.3061 53.6562 24.3785C53.605 24.4045 53.5554 24.4335 53.5077 24.4654C51.1056 26.0768 48.8478 26.0308 45.9671 24.3085C44.5197 23.32 41.5837 23.1611 39.9541 24.4266C38.9025 25.1029 38.0381 26.0333 37.4408 27.1317C36.8435 28.2302 36.5325 29.4614 36.5365 30.7118V33.2124C36.2772 32.9993 36.0684 32.7314 35.925 32.428C35.7816 32.1245 35.7073 31.793 35.7073 31.4574V29.793C35.7073 25.5322 37.4846 22.5834 41.8426 19.614C42.4535 19.1982 42.9671 18.6551 43.348 18.0219C43.7289 17.3888 43.9681 16.6806 44.0491 15.9462C44.3864 12.9103 46.258 11.3724 49.6125 11.3716ZM42.9781 26.3894C43.5413 26.3894 44.1076 26.5022 44.3521 26.6774C44.3832 26.6999 44.4156 26.7216 44.4478 26.7414C48.2475 29.0291 51.7046 29.0839 55.0125 26.9086C55.356 26.7553 57.0461 26.072 58.1756 26.8833C58.6864 27.2611 59.1017 27.7533 59.3881 28.3204C59.6746 28.8875 59.8242 29.5138 59.8251 30.1492V39.1638C59.8346 40.5106 59.5775 41.846 59.0687 43.0931C58.5599 44.3401 57.8093 45.4742 56.8603 46.4299C55.9113 47.3856 54.7826 48.1442 53.5392 48.6618C52.2957 49.1794 50.9622 49.4459 49.6153 49.4459C48.2684 49.4459 46.9349 49.1794 45.6914 48.6618C44.448 48.1442 43.3193 47.3856 42.3703 46.4299C41.4213 45.4742 40.6707 44.3401 40.1619 43.0931C39.6531 41.846 39.396 40.5106 39.4055 39.1638L39.4051 30.7118C39.4026 29.9319 39.5988 29.1642 39.9752 28.4812C40.3516 27.7981 40.8958 27.2222 41.5564 26.8077C41.6082 26.7751 41.6578 26.7393 41.7049 26.7003C41.9698 26.4814 42.4723 26.3894 42.9781 26.3894ZM64.8091 35.3101C64.9906 35.3368 65.165 35.3995 65.322 35.4944C65.4791 35.5893 65.6156 35.7146 65.7237 35.8629C65.8941 36.1581 66.2926 37.3823 64.2707 40.7329L64.1755 40.8922C63.8002 41.5108 63.4455 42.0954 63.316 42.798C63.1702 43.5909 62.9076 44.1338 62.6138 44.2495C62.3092 44.316 61.9912 44.2814 61.708 44.151C62.3602 42.5697 62.6953 40.8757 62.6941 39.1652V36.4316C63.4779 36.2303 64.2027 35.8459 64.8091 35.3101V35.3101ZM34.7204 35.4301C35.2551 35.8691 35.8732 36.1952 36.5375 36.3886V39.1652C36.536 40.8714 36.8691 42.5613 37.5179 44.1393C37.3892 44.1108 37.2652 44.0643 37.1495 44.0011C37.0209 43.9282 36.63 43.7063 36.4562 42.7896C36.3224 42.087 35.9653 41.4972 35.5869 40.873L35.5019 40.7329C33.8673 38.0236 33.6415 36.4418 33.9752 35.8652C34.0639 35.7464 34.1755 35.6466 34.3035 35.5719C34.4315 35.4971 34.5733 35.4489 34.7204 35.4301ZM43.572 50.7798C45.2964 51.6836 47.2015 52.1892 49.1472 52.2594C51.0929 52.3295 53.0295 51.9624 54.8145 51.185C55.503 52.7783 56.4174 54.2641 57.5294 55.5966C55.8184 62.7256 51.9726 67.8702 46.0773 70.8823C43.7618 72.0558 41.27 72.8428 38.7005 73.2121V57.0594C40.6315 55.4367 42.498 53.2058 43.572 50.7798ZM59.8769 57.9292C60.5403 58.4659 61.2737 58.9097 62.0568 59.2486C59.9126 69.1211 55.1295 77.1108 47.8239 83.0068C45.0554 85.2523 41.984 87.0961 38.7005 88.4838V84.0797C41.0671 83.8122 45.8154 82.543 51.2503 77.062C51.383 76.9283 51.4881 76.7698 51.5595 76.5954C51.6309 76.4211 51.6673 76.2344 51.6666 76.0461C51.6658 75.8577 51.628 75.6713 51.5552 75.4975C51.4824 75.3238 51.3761 75.1661 51.2424 75.0334C50.9723 74.7656 50.6069 74.616 50.2266 74.6176C49.8462 74.6192 49.4821 74.7718 49.2143 75.0418C44.594 79.7008 40.6461 80.8889 38.7005 81.1832V76.1086C41.683 75.7301 44.5792 74.8464 47.265 73.4955C51.6634 71.2764 57.241 66.7984 59.8769 57.9292ZM35.8339 58.9941V91.0545L33.4518 89.7005V80.5235C33.4518 80.1431 33.3007 79.7783 33.0317 79.5093C32.7628 79.2403 32.398 79.0892 32.0176 79.0892C31.6372 79.0892 31.2724 79.2403 31.0034 79.5093C30.7344 79.7783 30.5833 80.1431 30.5833 80.5235V88.0716L27.1783 86.1354L26.7446 60.8925C27.4993 60.7008 28.3155 60.524 29.199 60.3588L29.1995 60.3593V69.4906C29.1995 69.871 29.3506 70.2358 29.6196 70.5047C29.8885 70.7737 30.2533 70.9248 30.6337 70.9248C31.0141 70.9248 31.3789 70.7737 31.6479 70.5047C31.9169 70.2358 32.068 69.871 32.068 69.4906V59.8938C32.635 59.8141 33.2247 59.7373 33.837 59.6632C34.5352 59.5528 35.2101 59.3267 35.8339 58.9941V58.9941ZM64.8642 59.841C66.498 60.0748 67.9475 60.3316 69.2384 60.6147C69.0142 63.3677 67.9385 70.5555 62.8514 75.4279C62.7154 75.5582 62.6063 75.714 62.5305 75.8864C62.4546 76.0589 62.4135 76.2446 62.4094 76.4329C62.4054 76.6212 62.4384 76.8085 62.5067 76.9841C62.575 77.1596 62.6772 77.32 62.8075 77.4561C62.9378 77.5921 63.0936 77.7012 63.2661 77.777C63.4385 77.8528 63.6242 77.894 63.8125 77.898C64.0008 77.9021 64.1881 77.8691 64.3637 77.8008C64.5392 77.7324 64.6996 77.6302 64.8357 77.4999C70.3593 72.2111 71.7222 64.7855 72.0583 61.3505C73.3289 61.7263 74.5513 62.2488 75.701 62.9075C75.6503 65.9403 74.7925 77.8281 64.76 84.4532C64.5999 84.5557 64.4618 84.689 64.3537 84.8453C64.2455 85.0016 64.1696 85.1779 64.1301 85.3639C64.0907 85.5498 64.0887 85.7418 64.1241 85.9285C64.1595 86.1153 64.2317 86.2931 64.3365 86.4517C64.4413 86.6103 64.5765 86.7465 64.7344 86.8524C64.8923 86.9583 65.0696 87.0317 65.2561 87.0685C65.4426 87.1052 65.6346 87.1045 65.8208 87.0664C66.007 87.0283 66.1838 86.9535 66.3409 86.8465C71.6878 83.3153 75.4975 77.9065 77.3575 71.2059C77.8907 69.2799 78.2534 67.3108 78.4416 65.3213C79.4455 66.6635 80.0371 68.2544 80.5654 70.1498L84.512 86.4113C84.9225 88.1121 84.7011 89.904 83.8891 91.4537C83.077 93.0034 81.7296 94.2053 80.0976 94.8358L69.314 99.013H62.5825C62.5992 98.5058 62.4787 98.0035 62.2337 97.5591C61.7499 96.6821 61.1164 95.8965 60.362 95.2377L62.8458 93.7904C65.7686 95.2672 69.0004 96.0285 72.275 96.0114C72.6684 96.0114 73.0714 96.0007 73.4819 95.9777C73.6716 95.9697 73.8579 95.924 74.0299 95.8434C74.2018 95.7628 74.3561 95.6488 74.4837 95.5081C74.6112 95.3674 74.7096 95.2027 74.773 95.0237C74.8364 94.8446 74.8636 94.6548 74.8531 94.4652C74.8426 94.2755 74.7945 94.0899 74.7116 93.919C74.6287 93.7481 74.5127 93.5953 74.3703 93.4696C74.228 93.3439 74.062 93.2477 73.8822 93.1867C73.7023 93.1256 73.5121 93.1009 73.3227 93.1139C70.8018 93.2547 68.2788 92.8773 65.9095 92.005L74.692 86.8875C75.0183 86.6948 75.2549 86.3808 75.3504 86.0141C75.4459 85.6474 75.3924 85.2578 75.2015 84.9304C75.0107 84.6031 74.6981 84.3645 74.332 84.2669C73.9659 84.1693 73.576 84.2205 73.2475 84.4093L57.5066 93.5817C56.1863 93.1236 54.7739 92.9966 53.3931 93.2117C52.0124 93.4269 50.7055 93.9776 49.5873 94.8157L48.6643 95.5001C48.5304 95.4205 48.3911 95.3438 48.2422 95.2723C47.9751 95.1448 47.7037 95.0231 47.428 94.9067C56.5064 90.843 59.3085 85.1014 59.4385 84.8249C59.595 84.4822 59.6103 84.0917 59.4813 83.7378C59.3522 83.3838 59.0891 83.0949 58.7488 82.9334C58.4084 82.7719 58.0182 82.7507 57.6624 82.8745C57.3066 82.9984 57.0138 83.2572 56.8473 83.5951C56.8392 83.6116 56.0169 85.2804 53.8191 87.3596C51.8123 89.2583 48.215 91.8914 42.4529 93.732C41.8642 93.7075 41.2745 93.7357 40.6908 93.8161L38.7005 92.6844V91.5671C42.6145 90.0729 46.2659 87.9655 49.5177 85.324C54.9887 80.9385 62.0006 72.9935 64.8642 59.841ZM23.8891 61.7828L24.2795 84.4873L24.2048 84.4481C23.8664 84.265 23.4693 84.2235 23.1004 84.3327C22.7315 84.4419 22.4209 84.6929 22.2367 85.0306C22.0525 85.3684 22.0098 85.7654 22.1178 86.1347C22.2258 86.5039 22.4758 86.8153 22.813 87.0005L31.3032 91.7814C31.3173 91.7895 31.3311 91.7978 31.3457 91.8052L37.2705 95.1733C36.4189 95.8053 35.7066 96.6058 35.1779 97.525C35.1707 97.5369 35.1643 97.549 35.1574 97.5614C34.9113 98.0057 34.7871 98.5071 34.7974 99.0148H28.1392L17.2893 94.8353C15.6584 94.2042 14.3121 93.0023 13.501 91.453C12.6898 89.9038 12.469 88.1126 12.8796 86.4127L16.8257 70.1512C17.9834 65.9983 19.5804 63.4623 23.8891 61.7828ZM54.4854 95.989C55.5433 95.9455 56.5925 96.1967 57.5161 96.7145C58.4397 97.2322 59.2014 97.9963 59.7163 98.9214C59.7134 98.952 59.6656 99.0144 59.6379 99.0144H50.5122C50.5835 98.5926 50.5633 98.1605 50.4529 97.7472L51.3003 97.1193C52.2238 96.4302 53.334 96.0362 54.4854 95.989ZM41.9412 96.5926C42.1716 96.5887 42.4018 96.5962 42.6307 96.6127H42.6457H42.6471C44.1604 96.7679 45.6344 97.1896 47.0008 97.8584C47.1767 97.9369 47.3382 98.0442 47.4788 98.1758C47.5934 98.2908 47.721 98.4521 47.6763 98.5689C47.5938 98.7032 47.4786 98.8144 47.3414 98.892C47.2042 98.9697 47.0496 99.0113 46.892 99.013H37.6776V98.9705L37.6706 98.9439C38.7185 97.1942 40.3283 96.6203 41.9412 96.5926ZM10.7796 101.883H57.7358C53.4157 103.661 49.3139 105.93 45.5109 108.643C34.377 116.48 24.2433 117.936 23.334 118.053H10.7796C9.7789 118.053 8.78805 117.856 7.86358 117.473C6.93911 117.09 6.09912 116.529 5.39157 115.821C4.68403 115.114 4.12279 114.274 3.7399 113.349C3.35701 112.425 3.15997 111.434 3.16003 110.433V109.502C3.16003 107.482 3.9628 105.544 5.39174 104.115C6.82067 102.686 8.75873 101.883 10.7796 101.883V101.883ZM9.70899 105.504C9.3286 105.504 8.96379 105.655 8.69481 105.924C8.42584 106.193 8.27473 106.557 8.27473 106.938C8.27473 107.318 8.42584 107.683 8.69481 107.952C8.96379 108.221 9.3286 108.372 9.70899 108.372H10.3542C10.7346 108.372 11.0994 108.221 11.3684 107.952C11.6374 107.683 11.7885 107.318 11.7885 106.938C11.7885 106.557 11.6374 106.193 11.3684 105.924C11.0994 105.655 10.7346 105.504 10.3542 105.504H9.70899ZM14.982 105.504C14.6016 105.504 14.2368 105.655 13.9678 105.924C13.6988 106.193 13.5477 106.557 13.5477 106.938C13.5477 107.318 13.6988 107.683 13.9678 107.952C14.2368 108.221 14.6016 108.372 14.982 108.372H33.3192C33.6996 108.372 34.0644 108.221 34.3334 107.952C34.6024 107.683 34.7535 107.318 34.7535 106.938C34.7535 106.557 34.6024 106.193 34.3334 105.924C34.0644 105.655 33.6996 105.504 33.3192 105.504H14.982Z",fill:"#D4D8DD"})),j3=s.div`
|
|
4781
|
+
`,{common:{strings:sn,datePicker:m3,texts:x3},dateFormat:rn,cockpit:h3,card:g3}=t.appLocale.getLocalizedStrings(),S3=({historicData:e,companyId:n,newThreadMetadata:r,containerRef:i,sortedThreads:a})=>{const{addThread:d,setOpenThread:l}=u.useContext(t.ThreadsContext),c=u.useRef(null),[p,m]=u.useState(),[x,g]=u.useState(!1),h="monthEndReportHistoricDataPage",j=t.useHandleSelection(t.MONTH_END_REPORT_CANVAS,!1,!1),b=i.current?.getBoundingClientRect(),C=j!=null&&j.coords!=null&&b?{left:j.coords.left-b.left,top:j.coords.top-b.top}:void 0,S=o.useForm({mode:"all",defaultValues:oi(e),values:oi(e)}),y=()=>{c.current&&c.current.scrollIntoView({behavior:"smooth"})};u.useEffect(()=>{m(J.mapAttachmentFileToAttachmentFilePayload(e.attachmentFile))},[e.attachmentFile]);const f=u.useCallback(()=>{const E=window.getSelection()?.getRangeAt(0),R=t.getSelectionData();if(!E||R==null)return;const I={...r,...R,startPath:R.startPath.join(),endPath:R.endPath.join()},A=`${o.nanoid()}${t.NEW_THREAD_SUFFIX}`,v=`cockpit_${n}`;d(A,{type:"thread",id:A,roomId:v,createdAt:new Date,updatedAt:new Date,comments:[],metadata:I,resolved:!1}),l(A)},[d,n,r,l]);return o.jsxRuntimeExports.jsx(o.FormProvider,{...S,children:o.jsxRuntimeExports.jsx("form",{id:f3(h),children:o.jsxRuntimeExports.jsxs(c3,{children:[o.jsxRuntimeExports.jsx(t.MonthEndReportSection,{previewMode:!0,subject:e.subject,sectionId:Jt}),o.jsxRuntimeExports.jsxs(Jj,{id:t.MONTH_END_REPORT_CANVAS,ref:i,children:[o.jsxRuntimeExports.jsxs(e3,{className:"monthEndReportCanvasWrapper",children:[p!=null?o.jsxRuntimeExports.jsx(t3,{onClick:y,children:o.jsxRuntimeExports.jsx(t.CircleWithAttachmentSuccessIcon,{loading:!1,fileSizeError:x,setFileSizeError:g})}):null,o.jsxRuntimeExports.jsx(t.StandardRegular,{style:{position:"relative"},dangerouslySetInnerHTML:{__html:t.getHTMLWithCommentingSections(e.concatenatedHtml)}}),p!=null?o.jsxRuntimeExports.jsx(t.FileAttachment,{ref:c,fileName:p.name,fileSize:t.base64FileSize(p.data),isRemovable:!1}):null]}),C?o.jsxRuntimeExports.jsx(t.AddThreadFloating,{style:{zIndex:15},coords:C,alignment:j.alignment,onClick:f}):null,o.jsxRuntimeExports.jsx(t.TextHighlightSection,{canvasContainerRef:i,sortedThreads:a,editorMode:!1})]})]})})})},y3=e=>{const{monthEndReportHistoricData:n,reportSentDate:r,onRefresh:i,onNavigateBack:a,onDateChange:d}=e,l=o.useTheme(),[c,p]=u.useState(!1),[m,x]=u.useState(),g=u.useRef(null),[h,j]=u.useState(0),[b,C]=u.useState(0),S=t.useDelayUnmount(c,250),{data:y,companyId:f,companyName:E,firstMonthOfFY:R}=n,I=t.getMonthIndex(r.format(rn.visual.MMMMFormat)),A=Number(r.format(rn.visual.YYYYformat)),v=R>I?A-1:A;u.useEffect(()=>{const re=I>0?I-1:12;x(`${o.padStart(re.toString(),2,"0")}${sn.backspace}${A}`)},[]);const T={application:"cockpit",companyId:f,entityId:f,tab:"management",isGlobalComment:!1,entityType:"management.monthEndEmail",companyName:E,url:window.location.href,selectedRange:m},{url:F,...D}=T,K={...D},M=n.fetchState==="Not-Started"||n.fetchState==="In-Progress",{threadsRefs:Y,sortedThreads:G,threadsPositions:w,observer:P,unresolvedThreadsMap:B,handleRemoveFloatingThread:k}=t.useFloatingThreads(K,g,!1,M),O=u.useRef(null),[z,Z]=u.useState(0),ie=u.useCallback(()=>{const re=Y.current?.[Y.current?.length-1];Z(window.scrollY+(re?.getBoundingClientRect()?.bottom??0))},[Y]),N=u.useCallback(()=>{c?C(Math.min((window.innerWidth-t.FORM_MINIMUM_WIDTH)/2,window.innerWidth-t.FORM_MINIMUM_WIDTH-t.COMMENTS_DRAWER_MAXIMUM_WIDTH-t.sp[4])):j(Math.min((window.innerWidth-t.FORM_MINIMUM_WIDTH)/2,window.innerWidth-t.FORM_MINIMUM_WIDTH-t.COMMENTS_SECTION_MINIMUM_WIDTH))},[c]);u.useEffect(()=>{N()},[c,N]),u.useEffect(()=>(window.addEventListener("resize",N),()=>{window.removeEventListener("resize",N)}),[N]),u.useEffect(()=>(window.addEventListener("scroll",ie),()=>window.removeEventListener("scroll",ie)),[ie]);const{openThread:H,setOpenThread:L}=u.useContext(t.ThreadsContext);u.useEffect(()=>{H!=null&&c&&p(!1)},[c,H,p]);const Q=t.getHistoricMonthsList(R,n.historicReportSentDates),se=u.useCallback((re,te)=>{const he=R>re?te+1:te;d(J.dateFromYearMonthDate(he,re-1));const fe=re>0?re-1:12;x(`${o.padStart(fe.toString(),2,"0")}${sn.backspace}${he}`)},[R,d]);if(n.fetchState==="Not-Started"||n.fetchState==="In-Progress")return o.jsxRuntimeExports.jsxs(Jn,{children:[o.jsxRuntimeExports.jsx(Qn,{children:o.jsxRuntimeExports.jsx(es,{onClick:a})}),o.jsxRuntimeExports.jsx(t.BusyIndication,{fetchState:n.fetchState,styles:{margin:t.Space.sp0}})]});if(n.fetchState==="Error")return o.jsxRuntimeExports.jsxs(Jn,{children:[o.jsxRuntimeExports.jsx(Qn,{children:o.jsxRuntimeExports.jsx(es,{onClick:a})}),o.jsxRuntimeExports.jsx(t.ReloadContainer,{onReload:i,message:g3.failedText})]});if(y?.concatenatedHtml==null)return o.jsxRuntimeExports.jsxs(Jn,{children:[o.jsxRuntimeExports.jsx(Qn,{children:o.jsxRuntimeExports.jsx(es,{onClick:a})}),o.jsxRuntimeExports.jsx(t.ReloadContainer,{onReload:i,message:h3.monthEndReport.insightsNotAvailable})]});const X=`cockpit_${f}`;return o.jsxRuntimeExports.jsx(Xe.RoomProvider,{id:X,children:o.jsxRuntimeExports.jsxs(o3,{children:[o.jsxRuntimeExports.jsx(Sa,{companyName:n.companyName,onNavigateBack:a,monthCalendar:{monthAndYears:Q,label:`${r.format(rn.visual.MMMformat)} ${v}`,selectedMonth:{month:I,year:v},onChange:se},threadMetadata:K,onAllThreadsClick:()=>{H!=null&&L(null),p(!0)}}),o.jsxRuntimeExports.jsxs(a3,{ref:O,style:z>0?{height:z}:void 0,children:[o.jsxRuntimeExports.jsx(n3,{availableWidth:c?b:h}),o.jsxRuntimeExports.jsxs(l3,{children:[o.jsxRuntimeExports.jsx(S3,{historicData:y,newThreadMetadata:T,companyId:f,sortedThreads:G,containerRef:g}),o.jsxRuntimeExports.jsxs(p3,{children:[o.jsxRuntimeExports.jsx(wi,{user:n.reportLastSentByUser}),o.jsxRuntimeExports.jsx(d3,{}),o.jsxRuntimeExports.jsxs(u3,{children:[m3.businessDay,sn.space,n.data?.reportSentDate!=null?J.getBusinessDayOfDate(n.data.reportSentDate):null,":",sn.space,n.data?.reportSentDate?.format(rn.visual.MMMDFormat)]})]})]}),S?o.jsxRuntimeExports.jsx(i3,{allThreadsSectionOpen:c,children:o.jsxRuntimeExports.jsx(t.AllThreadsSection,{autoExpand:!0,autoFocus:!1,style:{borderLeft:`1px solid ${l.colors.grey3}`,boxShadow:`${t.Space.sp0} 1px 2px ${t.Space.sp0} ${t.Colors.boxShadowElevation}`},drawerSectionStyle:{width:`calc(100% - ${t.Space.sp5} - ${t.Space.sp5})`,backgroundColor:l.colors.background},threadsContainerStyle:{paddingBottom:t.Space.sp5},collapsibleThreadStyle:{width:`calc(100% - ${t.Space.sp4})`},allowComposer:!1,drawerTitle:x3.comments,filter:K,textOverrides:{},preventResolvedThreadClick:!0,onThreadClick:(re,te)=>{L(te);const he=G.findIndex(fe=>fe[0]===te);p(!1),Y.current?.[he]?.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},onCloseAllThreadsDrawer:()=>p(!1)})}):o.jsxRuntimeExports.jsx(t.FloatingThreads,{observer:P,canvasContainerRef:g,sortedThreads:G,threadsPositions:w,threadsRefs:Y,unresolvedThreadsMap:B,editorMode:!1,style:{minWidth:`${t.COMMENTS_SECTION_MINIMUM_WIDTH}px`,position:"relative",height:"fit-content",width:"auto",top:`${g.current?.offsetTop}px`},handleRemoveFloatingThread:k})]})]})})},oi=e=>({[Jt]:{recipientEmailList:e.recipientEmailList??[],subject:e.subject??""}}),f3=e=>`${e}_form`,C3=e=>le.createElement("svg",{width:98,height:121,viewBox:"0 0 98 121",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M49.2796 0.921875C32.9744 0.921875 19.7096 14.1944 19.7096 30.5087C19.7125 35.7639 21.1132 40.9238 23.7681 45.459C26.423 49.9943 30.2365 53.7418 34.8175 56.317C34.4083 56.561 33.9588 56.7299 33.4901 56.8156C26.6518 57.6437 22.4965 58.8342 19.5952 60.7958C16.8429 62.6568 15.2375 65.1511 14.0552 69.4056C14.0509 69.4209 14.0466 69.4363 14.0431 69.4518L10.0918 85.7362C9.51826 88.1132 9.82738 90.6176 10.9617 92.7837C12.0961 94.9499 13.9785 96.6304 16.2589 97.5129L20.1569 99.0144H10.7796C7.99797 99.0144 5.33033 100.119 3.36345 102.086C1.39658 104.053 0.291567 106.721 0.291504 109.502V110.435C0.291815 113.216 1.39693 115.884 3.36378 117.85C5.33063 119.817 7.99813 120.922 10.7796 120.922H53.2747C53.6551 120.922 54.0199 120.771 54.2889 120.502C54.5579 120.233 54.709 119.868 54.709 119.488C54.709 119.107 54.5579 118.742 54.2889 118.473C54.0199 118.204 53.6551 118.053 53.2747 118.053H34.0289C38.6739 116.234 43.0832 113.862 47.1618 110.989C59.9371 101.998 69.4844 101.883 69.5755 101.883H86.6115C88.6324 101.883 90.5704 102.686 91.9994 104.115C93.4283 105.544 94.2311 107.482 94.2311 109.502V110.435C94.2308 112.455 93.4279 114.393 91.999 115.822C90.5701 117.251 88.6322 118.053 86.6115 118.053H62.8365C62.4561 118.053 62.0913 118.204 61.8223 118.473C61.5533 118.742 61.4022 119.107 61.4022 119.488C61.4022 119.868 61.5533 120.233 61.8223 120.502C62.0913 120.771 62.4561 120.922 62.8365 120.922H86.6115C89.3932 120.922 92.0609 119.817 94.0278 117.85C95.9947 115.883 97.0996 113.215 97.0996 110.433V109.501C97.0996 106.72 95.9947 104.052 94.0278 102.085C92.0609 100.118 89.3932 99.013 86.6115 99.013H77.2552L81.1289 97.5124C83.4101 96.6305 85.2933 94.95 86.4283 92.7836C87.5633 90.6172 87.8728 88.1123 87.2993 85.7348L83.3471 69.4504C83.3435 69.4349 83.3393 69.42 83.335 69.4047C81.0779 61.2834 76.7211 58.4595 63.9108 56.8156C63.6617 56.7812 63.4178 56.7159 63.1848 56.6214C67.9202 54.1003 71.88 50.3378 74.6396 45.7373C77.3993 41.1368 78.8546 35.872 78.8496 30.5073C78.8496 14.1942 65.5848 0.921875 49.2796 0.921875ZM50.0808 3.84176C56.084 4.02211 61.8511 6.22111 66.4504 10.0835C71.0497 13.9459 74.2125 19.2461 75.4278 25.1278C76.6431 31.0094 75.84 37.1291 73.1483 42.498C70.4565 47.867 66.0332 52.1716 60.5931 54.7165C59.1024 53.1795 57.8049 51.1354 57.3184 49.7456C58.4778 48.8954 59.4906 47.8615 60.3167 46.6848C60.9625 46.9809 61.6621 47.1419 62.3724 47.1577C62.8095 47.1603 63.2432 47.0811 63.6512 46.9243C64.5464 46.5762 65.7044 45.6681 66.1373 43.3181C66.2624 42.9869 66.4272 42.6721 66.628 42.3806L66.7279 42.2148C68.7825 38.8099 69.2671 36.263 68.2103 34.43C67.7877 33.7064 67.1417 33.1394 66.3694 32.8142C66.4922 32.3725 66.5552 31.9163 66.5566 31.4579V29.7934C66.5566 24.4319 64.183 20.499 58.861 17.0401C58.612 16.8783 58.3989 16.667 58.235 16.4194C58.071 16.1718 57.9598 15.8931 57.9081 15.6007C57.125 11.0899 54.1033 8.50358 49.6158 8.50358H49.613C42.7338 8.50525 41.4374 13.4875 41.1983 15.6301C41.1628 15.9531 41.0576 16.2647 40.8901 16.5432C40.7227 16.8217 40.4968 17.0607 40.2282 17.2436C36.7881 19.5877 32.8393 23.1325 32.8393 29.7934V31.4579C32.8389 31.9742 32.9165 32.4876 33.0695 32.9808C32.4212 33.2864 31.8789 33.7785 31.5119 34.3941C30.4489 36.1843 30.9504 38.7427 33.0456 42.2153L33.133 42.36C33.3398 42.6607 33.5094 42.9854 33.6381 43.3269C33.9878 45.1621 34.9709 46.0635 35.7344 46.4966C36.4514 46.8873 37.2576 47.0851 38.074 47.0704C38.4264 47.0695 38.7782 47.0401 39.1259 46.9826C39.7172 47.7756 40.3958 48.4996 41.1489 49.141C40.3987 51.1167 38.8989 53.0103 37.368 54.4238C32.9251 52.2043 29.188 48.7913 26.5758 44.5673C23.9635 40.3432 22.5793 35.4752 22.5781 30.5087C22.5811 26.9366 23.3008 23.4015 24.6945 20.1126C26.0883 16.8237 28.1278 13.8479 30.6922 11.3613C33.2567 8.87477 36.294 6.92806 39.6244 5.63643C42.9547 4.34481 46.5104 3.73454 50.0808 3.84176V3.84176ZM49.6125 11.3716H49.6148C52.6985 11.3716 54.5375 12.9592 55.0811 16.0909C55.2008 16.7719 55.4592 17.4211 55.8404 17.998C56.2216 18.575 56.7174 19.0673 57.2969 19.4445C61.7759 22.3556 63.6871 25.4502 63.6871 29.793V31.4574C63.6872 31.8279 63.5967 32.1929 63.4235 32.5204C63.2502 32.8479 62.9995 33.1281 62.6931 33.3366V30.1506C62.6908 29.0631 62.4335 27.9912 61.9419 27.0212C61.4503 26.0511 60.7381 25.2098 59.8624 24.5648C57.1677 22.6285 53.7984 24.3061 53.6562 24.3785C53.605 24.4045 53.5554 24.4335 53.5077 24.4654C51.1056 26.0768 48.8478 26.0308 45.9671 24.3085C44.5197 23.32 41.5837 23.1611 39.9541 24.4266C38.9025 25.1029 38.0381 26.0333 37.4408 27.1317C36.8435 28.2302 36.5325 29.4614 36.5365 30.7118V33.2124C36.2772 32.9993 36.0684 32.7314 35.925 32.428C35.7816 32.1245 35.7073 31.793 35.7073 31.4574V29.793C35.7073 25.5322 37.4846 22.5834 41.8426 19.614C42.4535 19.1982 42.9671 18.6551 43.348 18.0219C43.7289 17.3888 43.9681 16.6806 44.0491 15.9462C44.3864 12.9103 46.258 11.3724 49.6125 11.3716ZM42.9781 26.3894C43.5413 26.3894 44.1076 26.5022 44.3521 26.6774C44.3832 26.6999 44.4156 26.7216 44.4478 26.7414C48.2475 29.0291 51.7046 29.0839 55.0125 26.9086C55.356 26.7553 57.0461 26.072 58.1756 26.8833C58.6864 27.2611 59.1017 27.7533 59.3881 28.3204C59.6746 28.8875 59.8242 29.5138 59.8251 30.1492V39.1638C59.8346 40.5106 59.5775 41.846 59.0687 43.0931C58.5599 44.3401 57.8093 45.4742 56.8603 46.4299C55.9113 47.3856 54.7826 48.1442 53.5392 48.6618C52.2957 49.1794 50.9622 49.4459 49.6153 49.4459C48.2684 49.4459 46.9349 49.1794 45.6914 48.6618C44.448 48.1442 43.3193 47.3856 42.3703 46.4299C41.4213 45.4742 40.6707 44.3401 40.1619 43.0931C39.6531 41.846 39.396 40.5106 39.4055 39.1638L39.4051 30.7118C39.4026 29.9319 39.5988 29.1642 39.9752 28.4812C40.3516 27.7981 40.8958 27.2222 41.5564 26.8077C41.6082 26.7751 41.6578 26.7393 41.7049 26.7003C41.9698 26.4814 42.4723 26.3894 42.9781 26.3894ZM64.8091 35.3101C64.9906 35.3368 65.165 35.3995 65.322 35.4944C65.4791 35.5893 65.6156 35.7146 65.7237 35.8629C65.8941 36.1581 66.2926 37.3823 64.2707 40.7329L64.1755 40.8922C63.8002 41.5108 63.4455 42.0954 63.316 42.798C63.1702 43.5909 62.9076 44.1338 62.6138 44.2495C62.3092 44.316 61.9912 44.2814 61.708 44.151C62.3602 42.5697 62.6953 40.8757 62.6941 39.1652V36.4316C63.4779 36.2303 64.2027 35.8459 64.8091 35.3101V35.3101ZM34.7204 35.4301C35.2551 35.8691 35.8732 36.1952 36.5375 36.3886V39.1652C36.536 40.8714 36.8691 42.5613 37.5179 44.1393C37.3892 44.1108 37.2652 44.0643 37.1495 44.0011C37.0209 43.9282 36.63 43.7063 36.4562 42.7896C36.3224 42.087 35.9653 41.4972 35.5869 40.873L35.5019 40.7329C33.8673 38.0236 33.6415 36.4418 33.9752 35.8652C34.0639 35.7464 34.1755 35.6466 34.3035 35.5719C34.4315 35.4971 34.5733 35.4489 34.7204 35.4301ZM43.572 50.7798C45.2964 51.6836 47.2015 52.1892 49.1472 52.2594C51.0929 52.3295 53.0295 51.9624 54.8145 51.185C55.503 52.7783 56.4174 54.2641 57.5294 55.5966C55.8184 62.7256 51.9726 67.8702 46.0773 70.8823C43.7618 72.0558 41.27 72.8428 38.7005 73.2121V57.0594C40.6315 55.4367 42.498 53.2058 43.572 50.7798ZM59.8769 57.9292C60.5403 58.4659 61.2737 58.9097 62.0568 59.2486C59.9126 69.1211 55.1295 77.1108 47.8239 83.0068C45.0554 85.2523 41.984 87.0961 38.7005 88.4838V84.0797C41.0671 83.8122 45.8154 82.543 51.2503 77.062C51.383 76.9283 51.4881 76.7698 51.5595 76.5954C51.6309 76.4211 51.6673 76.2344 51.6666 76.0461C51.6658 75.8577 51.628 75.6713 51.5552 75.4975C51.4824 75.3238 51.3761 75.1661 51.2424 75.0334C50.9723 74.7656 50.6069 74.616 50.2266 74.6176C49.8462 74.6192 49.4821 74.7718 49.2143 75.0418C44.594 79.7008 40.6461 80.8889 38.7005 81.1832V76.1086C41.683 75.7301 44.5792 74.8464 47.265 73.4955C51.6634 71.2764 57.241 66.7984 59.8769 57.9292ZM35.8339 58.9941V91.0545L33.4518 89.7005V80.5235C33.4518 80.1431 33.3007 79.7783 33.0317 79.5093C32.7628 79.2403 32.398 79.0892 32.0176 79.0892C31.6372 79.0892 31.2724 79.2403 31.0034 79.5093C30.7344 79.7783 30.5833 80.1431 30.5833 80.5235V88.0716L27.1783 86.1354L26.7446 60.8925C27.4993 60.7008 28.3155 60.524 29.199 60.3588L29.1995 60.3593V69.4906C29.1995 69.871 29.3506 70.2358 29.6196 70.5047C29.8885 70.7737 30.2533 70.9248 30.6337 70.9248C31.0141 70.9248 31.3789 70.7737 31.6479 70.5047C31.9169 70.2358 32.068 69.871 32.068 69.4906V59.8938C32.635 59.8141 33.2247 59.7373 33.837 59.6632C34.5352 59.5528 35.2101 59.3267 35.8339 58.9941V58.9941ZM64.8642 59.841C66.498 60.0748 67.9475 60.3316 69.2384 60.6147C69.0142 63.3677 67.9385 70.5555 62.8514 75.4279C62.7154 75.5582 62.6063 75.714 62.5305 75.8864C62.4546 76.0589 62.4135 76.2446 62.4094 76.4329C62.4054 76.6212 62.4384 76.8085 62.5067 76.9841C62.575 77.1596 62.6772 77.32 62.8075 77.4561C62.9378 77.5921 63.0936 77.7012 63.2661 77.777C63.4385 77.8528 63.6242 77.894 63.8125 77.898C64.0008 77.9021 64.1881 77.8691 64.3637 77.8008C64.5392 77.7324 64.6996 77.6302 64.8357 77.4999C70.3593 72.2111 71.7222 64.7855 72.0583 61.3505C73.3289 61.7263 74.5513 62.2488 75.701 62.9075C75.6503 65.9403 74.7925 77.8281 64.76 84.4532C64.5999 84.5557 64.4618 84.689 64.3537 84.8453C64.2455 85.0016 64.1696 85.1779 64.1301 85.3639C64.0907 85.5498 64.0887 85.7418 64.1241 85.9285C64.1595 86.1153 64.2317 86.2931 64.3365 86.4517C64.4413 86.6103 64.5765 86.7465 64.7344 86.8524C64.8923 86.9583 65.0696 87.0317 65.2561 87.0685C65.4426 87.1052 65.6346 87.1045 65.8208 87.0664C66.007 87.0283 66.1838 86.9535 66.3409 86.8465C71.6878 83.3153 75.4975 77.9065 77.3575 71.2059C77.8907 69.2799 78.2534 67.3108 78.4416 65.3213C79.4455 66.6635 80.0371 68.2544 80.5654 70.1498L84.512 86.4113C84.9225 88.1121 84.7011 89.904 83.8891 91.4537C83.077 93.0034 81.7296 94.2053 80.0976 94.8358L69.314 99.013H62.5825C62.5992 98.5058 62.4787 98.0035 62.2337 97.5591C61.7499 96.6821 61.1164 95.8965 60.362 95.2377L62.8458 93.7904C65.7686 95.2672 69.0004 96.0285 72.275 96.0114C72.6684 96.0114 73.0714 96.0007 73.4819 95.9777C73.6716 95.9697 73.8579 95.924 74.0299 95.8434C74.2018 95.7628 74.3561 95.6488 74.4837 95.5081C74.6112 95.3674 74.7096 95.2027 74.773 95.0237C74.8364 94.8446 74.8636 94.6548 74.8531 94.4652C74.8426 94.2755 74.7945 94.0899 74.7116 93.919C74.6287 93.7481 74.5127 93.5953 74.3703 93.4696C74.228 93.3439 74.062 93.2477 73.8822 93.1867C73.7023 93.1256 73.5121 93.1009 73.3227 93.1139C70.8018 93.2547 68.2788 92.8773 65.9095 92.005L74.692 86.8875C75.0183 86.6948 75.2549 86.3808 75.3504 86.0141C75.4459 85.6474 75.3924 85.2578 75.2015 84.9304C75.0107 84.6031 74.6981 84.3645 74.332 84.2669C73.9659 84.1693 73.576 84.2205 73.2475 84.4093L57.5066 93.5817C56.1863 93.1236 54.7739 92.9966 53.3931 93.2117C52.0124 93.4269 50.7055 93.9776 49.5873 94.8157L48.6643 95.5001C48.5304 95.4205 48.3911 95.3438 48.2422 95.2723C47.9751 95.1448 47.7037 95.0231 47.428 94.9067C56.5064 90.843 59.3085 85.1014 59.4385 84.8249C59.595 84.4822 59.6103 84.0917 59.4813 83.7378C59.3522 83.3838 59.0891 83.0949 58.7488 82.9334C58.4084 82.7719 58.0182 82.7507 57.6624 82.8745C57.3066 82.9984 57.0138 83.2572 56.8473 83.5951C56.8392 83.6116 56.0169 85.2804 53.8191 87.3596C51.8123 89.2583 48.215 91.8914 42.4529 93.732C41.8642 93.7075 41.2745 93.7357 40.6908 93.8161L38.7005 92.6844V91.5671C42.6145 90.0729 46.2659 87.9655 49.5177 85.324C54.9887 80.9385 62.0006 72.9935 64.8642 59.841ZM23.8891 61.7828L24.2795 84.4873L24.2048 84.4481C23.8664 84.265 23.4693 84.2235 23.1004 84.3327C22.7315 84.4419 22.4209 84.6929 22.2367 85.0306C22.0525 85.3684 22.0098 85.7654 22.1178 86.1347C22.2258 86.5039 22.4758 86.8153 22.813 87.0005L31.3032 91.7814C31.3173 91.7895 31.3311 91.7978 31.3457 91.8052L37.2705 95.1733C36.4189 95.8053 35.7066 96.6058 35.1779 97.525C35.1707 97.5369 35.1643 97.549 35.1574 97.5614C34.9113 98.0057 34.7871 98.5071 34.7974 99.0148H28.1392L17.2893 94.8353C15.6584 94.2042 14.3121 93.0023 13.501 91.453C12.6898 89.9038 12.469 88.1126 12.8796 86.4127L16.8257 70.1512C17.9834 65.9983 19.5804 63.4623 23.8891 61.7828ZM54.4854 95.989C55.5433 95.9455 56.5925 96.1967 57.5161 96.7145C58.4397 97.2322 59.2014 97.9963 59.7163 98.9214C59.7134 98.952 59.6656 99.0144 59.6379 99.0144H50.5122C50.5835 98.5926 50.5633 98.1605 50.4529 97.7472L51.3003 97.1193C52.2238 96.4302 53.334 96.0362 54.4854 95.989ZM41.9412 96.5926C42.1716 96.5887 42.4018 96.5962 42.6307 96.6127H42.6457H42.6471C44.1604 96.7679 45.6344 97.1896 47.0008 97.8584C47.1767 97.9369 47.3382 98.0442 47.4788 98.1758C47.5934 98.2908 47.721 98.4521 47.6763 98.5689C47.5938 98.7032 47.4786 98.8144 47.3414 98.892C47.2042 98.9697 47.0496 99.0113 46.892 99.013H37.6776V98.9705L37.6706 98.9439C38.7185 97.1942 40.3283 96.6203 41.9412 96.5926ZM10.7796 101.883H57.7358C53.4157 103.661 49.3139 105.93 45.5109 108.643C34.377 116.48 24.2433 117.936 23.334 118.053H10.7796C9.7789 118.053 8.78805 117.856 7.86358 117.473C6.93911 117.09 6.09912 116.529 5.39157 115.821C4.68403 115.114 4.12279 114.274 3.7399 113.349C3.35701 112.425 3.15997 111.434 3.16003 110.433V109.502C3.16003 107.482 3.9628 105.544 5.39174 104.115C6.82067 102.686 8.75873 101.883 10.7796 101.883V101.883ZM9.70899 105.504C9.3286 105.504 8.96379 105.655 8.69481 105.924C8.42584 106.193 8.27473 106.557 8.27473 106.938C8.27473 107.318 8.42584 107.683 8.69481 107.952C8.96379 108.221 9.3286 108.372 9.70899 108.372H10.3542C10.7346 108.372 11.0994 108.221 11.3684 107.952C11.6374 107.683 11.7885 107.318 11.7885 106.938C11.7885 106.557 11.6374 106.193 11.3684 105.924C11.0994 105.655 10.7346 105.504 10.3542 105.504H9.70899ZM14.982 105.504C14.6016 105.504 14.2368 105.655 13.9678 105.924C13.6988 106.193 13.5477 106.557 13.5477 106.938C13.5477 107.318 13.6988 107.683 13.9678 107.952C14.2368 108.221 14.6016 108.372 14.982 108.372H33.3192C33.6996 108.372 34.0644 108.221 34.3334 107.952C34.6024 107.683 34.7535 107.318 34.7535 106.938C34.7535 106.557 34.6024 106.193 34.3334 105.924C34.0644 105.655 33.6996 105.504 33.3192 105.504H14.982Z",fill:"#D4D8DD"})),j3=s.div`
|
|
4782
4782
|
justify-content: center;
|
|
4783
4783
|
align-items: center;
|
|
4784
4784
|
display: flex;
|
|
@@ -4929,7 +4929,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
4929
4929
|
`,J3=s.div`
|
|
4930
4930
|
display: flex;
|
|
4931
4931
|
align-items: center;
|
|
4932
|
-
`,{dateFormat:ri}=t.appLocale.getLocalizedStrings(),eb=({companyView:e,companyNameSticky:n,isReviewVendorColumnVisible:r,totalHeight:i,analytics:a,addThreadRequestThreadId:d,setNoteData:l,setElementRef:c,setAddThreadRequestThreadId:p,onTransactionTagClicked:m,onClickAuditScore:x,onClickWarningsCount:
|
|
4932
|
+
`,{dateFormat:ri}=t.appLocale.getLocalizedStrings(),eb=({companyView:e,companyNameSticky:n,isReviewVendorColumnVisible:r,totalHeight:i,analytics:a,addThreadRequestThreadId:d,setNoteData:l,setElementRef:c,setAddThreadRequestThreadId:p,onTransactionTagClicked:m,onClickAuditScore:x,onClickWarningsCount:g,onCompanyNameClicked:h,onUncategorizedAccountsErrorClick:j,onReviewVendorTagClicked:b})=>{const C=t.useWindowSizeContext(),{name:S,companyId:y}=e,f=`cockpit_${y}`,E="audit.notes",{threads:R,isLoading:I}=t.useFilteredThreads({entityType:E,companyId:y},!1),{openThread:A,threads:v,addThread:T,removeThread:F,setOpenThread:D,setRequestToOpenThread:K}=u.useContext(t.ThreadsContext),M=A!==null?v.get(A):null,Y=A?.includes(y)===!0,G=A!=null&&v.get(A)==null&&Y,w=d!=null&&v.get(d)?.metadata.companyId===y,P=u.useCallback(()=>{A?.includes(t.NEW_THREAD_SUFFIX)===!0&&F(A),d!=null&&p(void 0)},[d,A,F,p]),B=L=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:L.isElementThreadOpen??!1,isElementThreadPresent:L.isElementThreadPresent??!1,itemKey:L.itemKey,elementThreadId:L.elementThreadId??"",roomId:f,addThreadRequestThreadId:d,openThreadId:A,threadStyle:L.threadStyle,openThreadMetadata:M?.metadata??null,onElementClick:O,onAddThreadClick:z}),k=u.useCallback(L=>{if(L===A)D(null);else if(v.has(L))D(L);else if(L.includes(t.NEW_THREAD_SUFFIX)){const[Q,se]=L.replace(t.NEW_THREAD_SUFFIX,"").split("."),X=Wt(Rt(Q),J.toReviewColumnKeyType(se),y,S);T(L,{type:"thread",id:L,roomId:f,createdAt:new Date,updatedAt:new Date,comments:[],metadata:X,resolved:!1}),D(L)}},[y,S,A,v,T,D,f]),O=u.useCallback((L,Q,se=!1)=>{const X=bt.find(re=>re.key===Q);if(K(null),X!=null&&(L.type==="contextmenu"||se===!0)){if(X.isThreadAllowed===!1)return;P(),L.preventDefault(),L.stopPropagation();const re=t.toCollaborationEntityType({tab:"audit",key:X.key}),te=[...t.getFilteredThreads(v,{entityType:re,companyId:y},"both")],he=te.length>0&&te[0].length>0?te[0][0]:Le("audit",X.key,y);v.has(he)?k(he):d===he?p(void 0):(p(he),D(null))}},[v,y,d,k,p,D,K,P]),z=u.useCallback((L,Q)=>{L.stopPropagation();const se=Le("audit",Q,y);p(void 0),k(se)},[y,p,k]),Z=()=>{h(e)},ie=u.useCallback(()=>{j(e.primaryEmailDomain)},[j,e.primaryEmailDomain]),N=()=>{if(e.auditSummary.auditReportLastGeneratedDate==null){const L=J.dateNow().startOf("month").subtract(1,"date").format(ri.analytics.MMMYYYYFormat),Q=e.controllers?.map(se=>`${se.user.firstName} ${se.user.middleName} ${se.user.lastName}`)??[];a.trackGetAuditScore(!0,e.name,L,Q,J.dateNow().format(ri.analytics.MMSlashDDSlashYYYYFormat))}x(e.companyId)},H=e.onboardingInfo?.uncategorizedExpenseAccountIdentified===!0&&e.onboardingInfo?.uncategorizedIncomeAccountIdentified===!0;return o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{K(null),d!=null&&(p(void 0),d.includes(t.NEW_THREAD_SUFFIX)&&F(d))},children:o.jsxRuntimeExports.jsx(rb,{windowSize:C,isThreadOpen:Y||w,totalHeight:i,isCreationInProgress:G,children:bt.map((L,Q)=>{const se=t.toCollaborationEntityType({tab:"audit",key:L.key}),X=bt.length-2<=Q,re=[...t.getFilteredThreads(v,{entityType:se,companyId:y},"both")],te=re.length>0&&re[0].length>0?re[0][0]:Le("audit",L.key,y),he=v.get(te),fe=he!=null&&he.resolved===!1,be=te===A,W=d===te;switch(L.key){case"companyName":return o.jsxRuntimeExports.jsxs(ob,{companyNameSticky:n,columnWidth:L.width,windowSize:C,isThreadOpen:be||W,isThreadAllowed:L.isThreadAllowed,className:oe,onContextMenu:ee=>O(ee,L.key),ref:ee=>{c(y,L.key,ee)},children:[o.jsxRuntimeExports.jsxs(sb,{children:[o.jsxRuntimeExports.jsx(nb,{onClick:ee=>{ee.preventDefault(),Z()},children:S}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:be,roomId:f,openThreadId:A,openThreadMetadata:M?.metadata??null})]}),o.jsxRuntimeExports.jsxs(ib,{className:"notesIcon",onClick:ee=>{ee.preventDefault(),l({roomId:f,companyId:y,companyName:S,entityType:E})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:R.length,isLoading:I}),o.jsxRuntimeExports.jsx(ab,{})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:fe,itemKey:L.key,style:{left:t.Space.sp4},onElementClick:O}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Le("audit",L.key,y),addThreadRequestThreadId:d,itemKey:L.key,onAddThreadClick:z})]},te);case"auditScore":return o.jsxRuntimeExports.jsxs(Co,{ref:ee=>{c(y,L.key,ee)},columnWidth:L.width,windowSize:C,isThreadAllowed:L.isThreadAllowed,className:oe,onContextMenu:ee=>O(ee,L.key),children:[o.jsxRuntimeExports.jsx(M3,{auditSummary:e.auditSummary,onClickScore:N}),B({isElementThreadOpen:be,isElementThreadPresent:fe,itemKey:L.key,elementThreadId:te,threadStyle:X?{right:t.Space.sp0}:void 0})]},te);case"uncategorized":return o.jsxRuntimeExports.jsxs(Co,{ref:ee=>{c(y,L.key,ee)},columnWidth:L.width,windowSize:C,isThreadAllowed:L.isThreadAllowed,className:oe,onContextMenu:ee=>O(ee,L.key),children:[H===!0?o.jsxRuntimeExports.jsx(si,{onTransactionTagClicked:ee=>m(e,ee,"uncategorized"),...e.uncategorizedTransactions}):o.jsxRuntimeExports.jsxs(cb,{onClick:ie,children:[o.jsxRuntimeExports.jsx(t.SvgHighImportance,{className:"alert-icon",width:t.sp[3],height:t.sp[3]}),o.jsxRuntimeExports.jsx(lb,{children:t.appLocale.getLocalizedStrings().cockpit.review.selectUncategorizedAccounts})]}),B({isElementThreadOpen:be,isElementThreadPresent:fe,itemKey:L.key,elementThreadId:te,threadStyle:X?{right:t.Space.sp0}:void 0})]},te);case"miscategorized":return o.jsxRuntimeExports.jsxs(Co,{ref:ee=>{c(y,L.key,ee)},columnWidth:L.width,windowSize:C,isThreadAllowed:L.isThreadAllowed,className:oe,onContextMenu:ee=>O(ee,L.key),children:[o.jsxRuntimeExports.jsx(si,{onTransactionTagClicked:ee=>m(e,ee,"miscategorized"),...e.miscategorizedTransactions}),B({isElementThreadOpen:be,isElementThreadPresent:fe,itemKey:L.key,elementThreadId:te,threadStyle:X?{right:t.Space.sp0}:void 0})]},te);case"reviewVendor":return r?o.jsxRuntimeExports.jsxs(Co,{ref:ee=>{c(y,L.key,ee)},columnWidth:L.width,windowSize:C,isThreadAllowed:L.isThreadAllowed,className:oe,onContextMenu:ee=>O(ee,L.key),children:[o.jsxRuntimeExports.jsx(tb,{widthSize:L.width,windowSize:C,children:o.jsxRuntimeExports.jsx(W3,{onReviewVendorTagClicked:()=>b(e),isReviewComplete:!e.isVendorReviewReqiured})}),B({isElementThreadOpen:be,isElementThreadPresent:fe,itemKey:L.key,elementThreadId:te,threadStyle:X?{right:t.Space.sp0}:void 0})]},te):null;case"warnings":return o.jsxRuntimeExports.jsxs(Co,{ref:ee=>{c(y,L.key,ee)},columnWidth:L.width,windowSize:C,isThreadAllowed:L.isThreadAllowed,className:oe,onContextMenu:ee=>O(ee,L.key),children:[o.jsxRuntimeExports.jsx(Y3,{companyId:e.companyId,warningsCount:J.getAuditWarningsCount(e),onClick:g}),B({isElementThreadOpen:be,isElementThreadPresent:fe,itemKey:L.key,elementThreadId:te,threadStyle:X?{right:t.Space.sp0}:void 0})]},te);default:return null}})})})},tb=s.div`
|
|
4933
4933
|
display: flex;
|
|
4934
4934
|
align-items: flex-start;
|
|
4935
4935
|
width: ${e=>e.widthSize.valuePx(e.windowSize)};
|
|
@@ -5055,7 +5055,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
5055
5055
|
svg {
|
|
5056
5056
|
color: ${t.Colors.important};
|
|
5057
5057
|
}
|
|
5058
|
-
`,{common:{headers:{comments:db}},collaboration:{threads:{placeholder:{addANewComment:pb,replyAComment:ub},tooltip:{resolveComment:mb,unResolveComment:xb}}}}=t.appLocale.getLocalizedStrings(),hb=({reviewView:e,allUsers:n,isReviewVendorColumnVisible:r,analytics:i,onColumnSortConfigChanged:a,onClickAuditScore:d,onClickWarningsCount:l,onTransactionTagClicked:c,onCompanyNameClicked:p,onRetryBankAccountConnection:m,onUncategorizedAccountsErrorClick:x,onReviewVendorTagClicked:
|
|
5058
|
+
`,{common:{headers:{comments:db}},collaboration:{threads:{placeholder:{addANewComment:pb,replyAComment:ub},tooltip:{resolveComment:mb,unResolveComment:xb}}}}=t.appLocale.getLocalizedStrings(),hb=({reviewView:e,allUsers:n,isReviewVendorColumnVisible:r,analytics:i,onColumnSortConfigChanged:a,onClickAuditScore:d,onClickWarningsCount:l,onTransactionTagClicked:c,onCompanyNameClicked:p,onRetryBankAccountConnection:m,onUncategorizedAccountsErrorClick:x,onReviewVendorTagClicked:g,initialOpenThreadRequest:h})=>{const j=t.useWindowSizeContext(),b=u.useRef(null),[C,S]=u.useState(null),[y,f]=u.useState(null),{uiState:E}=e,R=!(j==="small"||j==="medium-compact"),I=w=>e.companies[w].name.length>_t?Ie+32:Ie;u.useEffect(()=>{b.current&&b.current.resetAfterIndex(0)},[e]);const{setOpenThread:A,setRequestToOpenThread:v,requestToOpenThread:T,isLoading:F}=u.useContext(t.ThreadsContext);u.useEffect(()=>{h!=null&&e.fetchState==="Completed"&&F===!1&&v(h)},[h,e.fetchState,F,v]);const[D,K]=u.useState(void 0),M=u.useRef([]),Y=u.useMemo(()=>({makeCompanyNameSticky:R,uiState:E,isReviewVendorColumnVisible:r,onColumnSortConfigChanged:a}),[R,E,r,a]),G=u.useCallback((w,P,B)=>{const k=e.companies.findIndex(z=>z.companyId===w),O=bt.findIndex(z=>z.key===P);k!==-1&&O!==-1&&(M.current[k]==null?M.current[k]=[B]:M.current[k][O]=B)},[e.companies]);return u.useEffect(()=>{if(T!=null&&C!=null){const{companyId:w,entityType:P}=T,[B,k]=P.split("."),O=e.companies.findIndex(N=>N.companyId===w),z=bt.findIndex(N=>N.key===k);O!==-1&&!(C.visibleStartIndex<=O&&C.visibleStopIndex>=O)&&b.current?.scrollToItem(O,"center"),setTimeout(()=>{const N=M.current[O]?.[0]?.getBoundingClientRect().bottom,H=M.current[O]?.[0]?.getBoundingClientRect().top;N!=null&&H!=null&&(window.innerHeight>=N&&window.innerHeight>=H||H<0)&&M.current[O][z]?.scrollIntoView({block:"center",behavior:"auto"})},0);const ie=setInterval(()=>{const N=M.current[O]?.[z]?.getBoundingClientRect().left,H=M.current[O]?.[z]?.getBoundingClientRect().right,L=M.current[O]?.[z]?.offsetWidth;if(N!=null&&L!=null&&H!=null&&(N<window.innerWidth-L||H<window.innerWidth)){clearInterval(ie);const Q=T.threadId,se=T.onThreadShownCallback;Q&&(v(null),A(T.threadId),se?.())}},500);setTimeout(()=>{clearInterval(ie),v(null)},2e3)}},[T,C,A,v]),o.jsxRuntimeExports.jsx(gb,{children:o.jsxRuntimeExports.jsxs(ya.Provider,{value:Y,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:w,width:P})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:w,innerElementType:fa,itemCount:e.companies.length,itemSize:I,onItemsRendered:B=>S(B),itemData:{reviewView:e,isReviewVendorColumnVisible:r,analytics:i,makeCompanyNameSticky:R,allUsers:n,addThreadRequestThreadId:D,setElementRef:G,setAddThreadRequestThreadId:K,setNoteData:f,onTransactionTagClicked:c,onCompanyNameClicked:p,onRetryBankAccountConnection:m,onUncategorizedAccountsErrorClick:x,onReviewVendorTagClicked:g,onClickAuditScore:d,onClickWarningsCount:l},width:P,ref:b,overscanCount:Bt,children:Ca})}),y!=null?o.jsxRuntimeExports.jsx(Xe.RoomProvider,{id:y.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${y.companyName} ${db}`,filter:{application:"cockpit",companyId:y.companyId,entityType:y.entityType,isGlobalComment:!1,tab:"audit"},isLoading:!1,threadMetadata:{companyName:y.companyName,companyId:y.companyId,entityId:y.companyId,entityType:y.entityType,isGlobalComment:!1,application:"cockpit",tab:"audit",url:window.location.href},textOverrides:{composerPlaceholder:pb,replyComposerPlaceholder:ub,threadResolve:mb,threadUnResolve:xb},onThreadClick:w=>null,onCloseAllThreadsDrawer:()=>f(null)})}):null]})})},ya=u.createContext(void 0),fa=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,isReviewVendorColumnVisible:c,onColumnSortConfigChanged:p}=u.useContext(ya);return o.jsxRuntimeExports.jsxs(fb,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(E3,{companyNameSticky:d,onColumnSortConfigChanged:p,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder},isReviewVendorColumnVisible:c}),o.jsxRuntimeExports.jsx(yb,{children:r})]})});fa.displayName="Review list view inner element type";const Ca=({index:e,style:n,data:r})=>{const{reviewView:i,isReviewVendorColumnVisible:a,makeCompanyNameSticky:d,allUsers:l,analytics:c,addThreadRequestThreadId:p,setElementRef:m,setNoteData:x,onCompanyNameClicked:g,onTransactionTagClicked:h,setAddThreadRequestThreadId:j,onUncategorizedAccountsErrorClick:b,onReviewVendorTagClicked:C,onClickAuditScore:S,onClickWarningsCount:y}=r,f=i.companies[e],{companyId:E}=f;return o.jsxRuntimeExports.jsx(Sb,{style:{...n,width:"fit-content",minWidth:"100%"},children:o.jsxRuntimeExports.jsx(eb,{totalHeight:typeof n.height=="number"?n.height:Ie,addThreadRequestThreadId:p,setNoteData:x,setElementRef:m,setAddThreadRequestThreadId:j,analytics:c,companyView:i.companies[e],isReviewVendorColumnVisible:a,companyNameSticky:d,onCompanyNameClicked:g,onTransactionTagClicked:h,allUsers:l,onUncategorizedAccountsErrorClick:b,onReviewVendorTagClicked:C,onClickWarningsCount:y,onClickAuditScore:S})},E)};Ca.displayName="ListItem";const gb=s.div`
|
|
5059
5059
|
/** Subtract top so list can occupy remaining available height */
|
|
5060
5060
|
height: calc(100vh - 150px);
|
|
5061
5061
|
max-width: 99.9%;
|
|
@@ -5084,7 +5084,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
5084
5084
|
height: calc(100vh - 60px);
|
|
5085
5085
|
overflow-y: hidden;
|
|
5086
5086
|
background-color: ${e=>e.theme.colors.grey4};
|
|
5087
|
-
`,Rb=({headerData:e,headerActions:n,initialOpenThreadRequest:r,reviewPageActions:i,reviewPageData:a,analytics:d})=>{const{reviewView:l,zeniUserFetchState:c,allUsers:p,isReviewVendorColumnVisible:m}=a,{onColumnSortConfigChanged:x,onCockpitReloadData:
|
|
5087
|
+
`,Rb=({headerData:e,headerActions:n,initialOpenThreadRequest:r,reviewPageActions:i,reviewPageData:a,analytics:d})=>{const{reviewView:l,zeniUserFetchState:c,allUsers:p,isReviewVendorColumnVisible:m}=a,{onColumnSortConfigChanged:x,onCockpitReloadData:g,onCompanyNameClicked:h,onClickAuditScore:j,onClickWarningsCount:b,onTransactionTagClicked:C,onRetryBankAccountConnection:S,onReviewVendorTagClicked:y,onUncategorizedAccountsErrorClick:f}=i,E=l.uiState.filterText,R=l.fetchState==="Completed",I=u.useMemo(()=>n.filterActions?{...n,filterActions:{...n.filterActions}}:n,[n]);return o.jsxRuntimeExports.jsxs(bb,{children:[o.jsxRuntimeExports.jsx(dt,{headerActions:I,headerData:{...e,allTabOptions:e.allTabOptions??rt,filterData:{filterText:E,disableFilters:!0},selectedTabOption:"audit",companiesLoaded:R}}),o.jsxRuntimeExports.jsx($b,{allUsers:p,analytics:d,initialOpenThreadRequest:r,isReviewVendorColumnVisible:m,reviewView:l,zeniUserFetchState:c,onColumnSortConfigChanged:x,onCockpitReloadData:g,onCompanyNameClicked:h,onClickAuditScore:j,onClickWarningsCount:b,onRetryBankAccountConnection:S,onReviewVendorTagClicked:y,onTransactionTagClicked:C,onUncategorizedAccountsErrorClick:f})]})},$b=({reviewView:e,zeniUserFetchState:n,allUsers:r,isReviewVendorColumnVisible:i,analytics:a,initialOpenThreadRequest:d,onClickAuditScore:l,onColumnSortConfigChanged:c,onCockpitReloadData:p,onCompanyNameClicked:m,onClickWarningsCount:x,onTransactionTagClicked:g,onRetryBankAccountConnection:h,onReviewVendorTagClicked:j,onUncategorizedAccountsErrorClick:b})=>{const C=t.useWindowSizeContext();return e.fetchState==="Error"?o.jsxRuntimeExports.jsx($t,{onCockpitReloadData:p,selectedCockpitOption:"audit"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"||n==="In-Progress"||n==="Not-Started"?o.jsxRuntimeExports.jsx(Cb,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})}):e.companies.length===0?e.uiState.filterText.trim().length>0?o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextFirstLine,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine}):o.jsxRuntimeExports.jsx($3,{}):o.jsxRuntimeExports.jsx(jb,{windowSize:C,children:o.jsxRuntimeExports.jsx(hb,{allUsers:r,analytics:a,initialOpenThreadRequest:d,isReviewVendorColumnVisible:i,reviewView:e,onColumnSortConfigChanged:c,onCompanyNameClicked:m,onClickAuditScore:l,onClickWarningsCount:x,onRetryBankAccountConnection:h,onReviewVendorTagClicked:j,onTransactionTagClicked:g,onUncategorizedAccountsErrorClick:b})})},Eb=s.div`
|
|
5088
5088
|
display: flex;
|
|
5089
5089
|
width: 100%;
|
|
5090
5090
|
padding: ${t.Space.sp3};
|
|
@@ -5132,7 +5132,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
5132
5132
|
`,Ob=s(t.StandardRegular)`
|
|
5133
5133
|
margin-bottom: ${t.Space.sp4};
|
|
5134
5134
|
color: ${e=>e.theme.colors.hero};
|
|
5135
|
-
`,Nb=({auditSummaryData:e,isAuditScoreLoadingCompleted:n,isMonthEnd:r})=>{const i=!n,a=o.useTheme(),{common:d,dateFormat:l,cockpit:c}=t.appLocale.getLocalizedStrings(),p=e,m=r?p.bypassedAuditScore:p.auditScorePercentage;let x;m<=50?x=t.Colors.important:m<=75?x=t.Colors.alert:x=t.Colors.success;const
|
|
5135
|
+
`,Nb=({auditSummaryData:e,isAuditScoreLoadingCompleted:n,isMonthEnd:r})=>{const i=!n,a=o.useTheme(),{common:d,dateFormat:l,cockpit:c}=t.appLocale.getLocalizedStrings(),p=e,m=r?p.bypassedAuditScore:p.auditScorePercentage;let x;m<=50?x=t.Colors.important:m<=75?x=t.Colors.alert:x=t.Colors.success;const g=u.useCallback(()=>p.fixesRequired>0?`${d.strings.openingBrace}${p.fixesRequired} ${p.fixesRequired>1?d.texts.issues:d.texts.issue}${d.strings.closingBrace}`:d.strings.empty,[p.fixesRequired,d.strings,d.texts]);return o.jsxRuntimeExports.jsx(Eb,{isAuditScoreLoading:i,children:o.jsxRuntimeExports.jsx(vb,{auditPercentage:m,children:o.jsxRuntimeExports.jsxs(wb,{children:[!i&&o.jsxRuntimeExports.jsx(kb,{children:o.jsxRuntimeExports.jsx(o.CircularProgressbar,{value:m,text:`${Math.ceil(m)}${d.strings.percentage}`,strokeWidth:10,styles:o.buildStyles({rotation:.5,strokeLinecap:"butt",pathColor:x,textColor:a.colors.primary,trailColor:a.colors.grey3,textSize:t.Space.sp4})})}),o.jsxRuntimeExports.jsx(Tb,{children:o.jsxRuntimeExports.jsxs(Lb,{children:[o.jsxRuntimeExports.jsxs(Pb,{children:[o.jsxRuntimeExports.jsx(Ib,{children:i?c.monthEndReport.auditScoreSectionLoadingTitle.replace("__date__",J.dateNow().subtract(1,"month").format(l.visual.MMMMYYYYFormat)):c.monthEndReport.auditScoreSectionTitle}),i?null:o.jsxRuntimeExports.jsx(Ab,{children:g()})]}),o.jsxRuntimeExports.jsx(Db,{children:o.jsxRuntimeExports.jsx(Ob,{children:i?c.review.auditReportDrawer.subTitle:c.review.auditReportDrawer.reportGeneratedSubtitle})})]})})]})})})},Mb=({open:e,anchorElement:n,children:r,onClose:i})=>{const a=o.useTheme();return o.jsxRuntimeExports.jsx(o.Popover,{transitionDuration:0,anchorEl:n,open:e,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},PaperProps:{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",background:a.colors.grey5,boxSizing:"border-box",transform:"translate(0px,30px)",padding:t.Space.sp3,borderRadius:t.Space.sp2}},onClose:i,children:r})},zb=({rule:e,commentsText:n,ruleGroup:r,isControllerOrReviewer:i,triggerComponent:a,setCommentsText:d,handleReasonAuditRule:l})=>{const[c,p]=u.useState(!1),[m,x]=u.useState(n),g=u.useRef(null),{cockpit:h,common:j}=t.appLocale.getLocalizedStrings(),b=o.useTheme();u.useEffect(()=>{n!==""&&p(!0)},[n]);const C=()=>{m!==""&&e.reasonUpdateFetchState.fetchState!=="In-Progress"&&l(e.auditRuleId,r.auditRuleGroupId,m,i?"approved":"pending")};return o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{p(!1)},children:o.jsxRuntimeExports.jsxs(Gb,{ref:g,children:[a!=null?o.jsxRuntimeExports.jsxs(Kb,{className:"placeholder",onClick:()=>{p(!c)},children:[a," "]}):null,c?o.jsxRuntimeExports.jsxs(Mb,{open:c,anchorElement:g.current,onClose:()=>p(!1),children:[o.jsxRuntimeExports.jsx(_b,{children:o.jsxRuntimeExports.jsx(Fb,{children:h.review.auditReportDrawer.commentTitle})}),o.jsxRuntimeExports.jsx(Yb,{autoFocus:!0,onFocus:S=>{if(S.target instanceof HTMLTextAreaElement){const y=S.target.value;S.target.value="",S.target.value=y}},placeholder:h.commentPlaceholder,value:m,onChange:S=>{S.target instanceof HTMLTextAreaElement&&x(S.target.value)}}),o.jsxRuntimeExports.jsx(Vb,{}),o.jsxRuntimeExports.jsx(Ub,{}),o.jsxRuntimeExports.jsxs(Bb,{children:[o.jsxRuntimeExports.jsx(Hb,{}),o.jsxRuntimeExports.jsxs(Wb,{children:[o.jsxRuntimeExports.jsx(Zb,{disabled:e.reasonUpdateFetchState.fetchState==="In-Progress",size:"small",style:{whiteSpace:"nowrap",padding:`${t.Space.sp1} ${t.Space.sp3}`,borderRadius:t.Space.sp2},textStyle:{color:b.colors.primary},label:j.footer.cancel,onClick:()=>{n!==""&&l(e.auditRuleId,r.auditRuleGroupId,n,"pending"),d(""),p(!1)}}),o.jsxRuntimeExports.jsx(Xb,{disabled:m===""&&e.reasonUpdateFetchState.fetchState==="In-Progress",variant:"primary",size:"small",style:{whiteSpace:"nowrap",padding:i?`${t.Space.sp1} 14px`:`${t.Space.sp1} 22px`,borderRadius:t.Space.sp2},onClick:C,label:i?j.footer.resolve:j.footer.send,loading:e.reasonUpdateFetchState.fetchState==="In-Progress"})]})]})]}):null]})})},Fb=s(t.LargeRegular)`
|
|
5136
5136
|
color: ${e=>e.theme.colors.primary};
|
|
5137
5137
|
margin-bottom: ${t.Space.sp3};
|
|
5138
5138
|
`,Bb=s.div`
|
|
@@ -5182,7 +5182,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
5182
5182
|
color: ${e=>e.theme.colors.hero};
|
|
5183
5183
|
${t.textStyles.largeRegular.css};
|
|
5184
5184
|
}
|
|
5185
|
-
`,Zb=s(t.Button)``,Xb=s(t.Button)``,qb=({open:e,anchorElement:n,children:r,onClose:i})=>{const a=o.useTheme();return o.jsxRuntimeExports.jsx(o.Popover,{transitionDuration:0,anchorEl:n,open:e,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},PaperProps:{style:{width:"356px",display:"flex",flexDirection:"column",background:a.colors.grey5,boxSizing:"border-box",transform:"translate(0px,10px)",borderRadius:t.Space.sp2}},onClose:i,children:r})},Qb=({isControllerOrReviewer:e,allUsers:n,loggedInUser:r,rule:i,ruleGroup:a,triggerComponent:d,isDisabled:l=!1,handleReasonAuditRule:c,setCommentsText:p})=>{const[m,x]=u.useState(!1),
|
|
5185
|
+
`,Zb=s(t.Button)``,Xb=s(t.Button)``,qb=({open:e,anchorElement:n,children:r,onClose:i})=>{const a=o.useTheme();return o.jsxRuntimeExports.jsx(o.Popover,{transitionDuration:0,anchorEl:n,open:e,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},PaperProps:{style:{width:"356px",display:"flex",flexDirection:"column",background:a.colors.grey5,boxSizing:"border-box",transform:"translate(0px,10px)",borderRadius:t.Space.sp2}},onClose:i,children:r})},Qb=({isControllerOrReviewer:e,allUsers:n,loggedInUser:r,rule:i,ruleGroup:a,triggerComponent:d,isDisabled:l=!1,handleReasonAuditRule:c,setCommentsText:p})=>{const[m,x]=u.useState(!1),g=u.useRef(null),{cockpit:h,common:j,dateFormat:b,timeFormat:C}=t.appLocale.getLocalizedStrings(),S=i.reason!=null&&i.reason.userId?J.getUserFromAllUsers(n,i.reason.userId):void 0,y=i.reason?.reasonUpdatedAt,f=o.useTheme();return u.useEffect(()=>{i.reasonUpdateFetchState.fetchState==="Completed"&&x(!1)},[i.reasonUpdateFetchState.fetchState]),o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{x(!1)},children:o.jsxRuntimeExports.jsxs(l4,{ref:g,children:[o.jsxRuntimeExports.jsxs(a4,{className:"placeholder",onClick:()=>{x(E=>!E)},children:[d," "]}),m&&o.jsxRuntimeExports.jsxs(qb,{open:m,anchorElement:g.current,onClose:()=>x(!1),children:[o.jsxRuntimeExports.jsxs(c4,{children:[o.jsxRuntimeExports.jsxs(r4,{children:[o.jsxRuntimeExports.jsx(Jb,{children:S?.photo!=null?o.jsxRuntimeExports.jsx(i4,{src:S.photo.href,alt:h.userProfileAltText,onError:({currentTarget:E})=>{E.onerror=null,E.src=t.AvatarSVG}}):o.jsxRuntimeExports.jsx(t.EntityAvatarWithInitials,{firstName:S?.firstName??"",lastName:S?.lastName??""})}),o.jsxRuntimeExports.jsxs(s4,{children:[o.jsxRuntimeExports.jsx(n4,{children:`${J.getUserName(S)}`}),o.jsxRuntimeExports.jsxs(o4,{children:[o.jsxRuntimeExports.jsx(e4,{children:y!=null?J.zeniDate(y.toISOString()).format(b.visual.MMMDFormat)+j.strings.comma:j.strings.empty}),o.jsxRuntimeExports.jsx(t4,{children:y!=null?J.zeniDate(y.toISOString()).format(C.hhmmAFormat):j.strings.empty})]})]})]}),!e&&r.userId===i.reason?.userId?o.jsxRuntimeExports.jsx(t.MoreMenuButton,{moreIconType:"plain",options:[{label:j.edit,value:j.edit},{label:j.delete,value:j.delete}],onOptionSelection:E=>{c(i.auditRuleId,a.auditRuleGroupId,i.reason?.reasonToPass??"","rejected"),E===j.edit?p(i.reason?.reasonToPass??""):p("")},valueToIcon:E=>E===j.delete?o.jsxRuntimeExports.jsx(t.SvgDelete,{}):E===j.edit?o.jsxRuntimeExports.jsx(x4,{}):o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{}),customStyleConfig:{menuPortal:()=>({zIndex:1e4})},menuPortalTarget:document.body,menuPosition:"fixed"}):null]}),o.jsxRuntimeExports.jsx(d4,{children:o.jsxRuntimeExports.jsx(p4,{children:i.reason?.reasonToPass})}),e?o.jsxRuntimeExports.jsx(u4,{children:o.jsxRuntimeExports.jsxs(m4,{children:[o.jsxRuntimeExports.jsx(h4,{size:"small",style:{whiteSpace:"nowrap",padding:`${t.Space.sp1} 22px`,borderRadius:t.Space.sp2},textStyle:{color:f.colors.primary},disabled:i.reasonUpdateFetchState.fetchState==="In-Progress",onClick:()=>{i.reasonUpdateFetchState.fetchState!=="In-Progress"&&c(i.auditRuleId,a.auditRuleGroupId,i.reason?.reasonToPass??"","rejected")},label:j.footer.reject}),o.jsxRuntimeExports.jsx(g4,{variant:"primary",size:"small",style:{whiteSpace:"nowrap",padding:`${t.Space.sp1} 14px`,borderRadius:t.Space.sp2},label:j.footer.approve,disabled:i.reasonUpdateFetchState.fetchState==="In-Progress",onClick:()=>{l!==!0&&i.reasonUpdateFetchState.fetchState!=="In-Progress"&&c(i.auditRuleId,a.auditRuleGroupId,i.reason?.reasonToPass??"","approved")}})]})}):o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{})]})]})})},Jb=s.div`
|
|
5186
5186
|
display: flex;
|
|
5187
5187
|
margin-right: ${t.Space.sp2};
|
|
5188
5188
|
margin-left: ${t.Space.sp2};
|
|
@@ -5256,7 +5256,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
5256
5256
|
width: ${t.Space.sp4};
|
|
5257
5257
|
height: ${t.Space.sp4};
|
|
5258
5258
|
margin-left: -${t.Space.sp1};
|
|
5259
|
-
`,h4=s(t.Button)``,g4=s(t.Button)``,S4=({loggedInUser:e,isControllerOrReviewer:n,allUsers:r,isMonthEnd:i,rule:a,isGroupFixed:d,ruleGroup:l,onClickRule:c,handleReasonAuditRule:p})=>{const m=()=>{c(a.entityType,a.entityIds[0],a.auditRuleId)},[x,
|
|
5259
|
+
`,h4=s(t.Button)``,g4=s(t.Button)``,S4=({loggedInUser:e,isControllerOrReviewer:n,allUsers:r,isMonthEnd:i,rule:a,isGroupFixed:d,ruleGroup:l,onClickRule:c,handleReasonAuditRule:p})=>{const m=()=>{c(a.entityType,a.entityIds[0],a.auditRuleId)},[x,g]=u.useState(""),{cockpit:h,common:j}=t.appLocale.getLocalizedStrings(),b=i&&l.ruleType===h.review.auditReportDrawer.Business.toLowerCase()&&!a.isSuccess,C=o.useTheme(),S=b&&a.reason?.reasonStatus==="approved";return o.jsxRuntimeExports.jsxs(y4,{children:[o.jsxRuntimeExports.jsxs(f4,{onClick:y=>{y.stopPropagation(),m()},children:[a.isSuccess?o.jsxRuntimeExports.jsx(C4,{}):S?o.jsxRuntimeExports.jsx(j4,{}):o.jsxRuntimeExports.jsx(b4,{width:t.sp[3],height:t.sp[3]}),o.jsxRuntimeExports.jsx(R4,{isGroupFixed:d,children:a.message}),S?o.jsxRuntimeExports.jsx($4,{children:h.monthEndReport.issueBypassed}):null]}),b&&(a.reason?.reasonStatus==="pending"?o.jsxRuntimeExports.jsx(Qb,{rule:a,ruleGroup:l,handleReasonAuditRule:p,triggerComponent:o.jsxRuntimeExports.jsx(t.Button,{variant:"outline",buttonColors:{borderColor:{default:t.Colors.brandColorGoldDark,hover:t.Colors.brandColorGoldDark,disabled:t.Colors.brandColorGoldDark},backgroundColor:{default:t.Colors.brandColorGoldDark,hover:t.Colors.brandColorGoldDark,disabled:t.Colors.brandColorGoldDark},textColor:{disabled:t.Colors.primaryWhite,default:t.Colors.primaryWhite,hover:t.Colors.primaryWhite}},size:"small",loading:a.reasonUpdateFetchState.fetchState==="In-Progress",style:{whiteSpace:"nowrap",padding:`2px ${t.Space.sp2}`},label:a.reason.userId===e.userId?j.footer.sentForReview:j.footer.inReview}),isControllerOrReviewer:n,allUsers:r,loggedInUser:e,setCommentsText:g}):a.reason?.reasonStatus==null?o.jsxRuntimeExports.jsx(zb,{rule:a,commentsText:x,setCommentsText:g,ruleGroup:l,handleReasonAuditRule:p,isControllerOrReviewer:n,triggerComponent:o.jsxRuntimeExports.jsx(t.Button,{disabled:a.reasonUpdateFetchState.fetchState==="In-Progress",buttonColors:C.mode==="dark"?{borderColor:{default:t.Colors.primaryLight,hover:t.Colors.championLight,disabled:t.Colors.championLight},backgroundColor:{default:t.Colors.primaryLight,hover:t.Colors.championLight,disabled:t.Colors.championLight},textColor:{default:t.Colors.primaryDark,hover:t.Colors.primaryDark,disabled:t.Colors.primaryDark}}:{borderColor:{default:C.colors.primary,hover:C.colors.champion,disabled:C.colors.champion},backgroundColor:{default:C.colors.primary,hover:C.colors.champion,disabled:C.colors.grey3},textColor:{default:C.colors.grey5,hover:C.colors.grey5,disabled:C.colors.grey5}},size:"small",style:{whiteSpace:"nowrap",padding:`2px ${t.Space.sp2}`},label:j.footer.resolve,reverseSpinnerColor:!0})}):null)]})},y4=s.div`
|
|
5260
5260
|
display: flex;
|
|
5261
5261
|
justify-content: space-between;
|
|
5262
5262
|
align-items: center;
|
|
@@ -5294,7 +5294,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
5294
5294
|
justify-content: space-around;
|
|
5295
5295
|
align-items: center;
|
|
5296
5296
|
color: ${t.Colors.brandColorGoldDark};
|
|
5297
|
-
`,Qt=t.appLocale.getLocalizedStrings(),{cockpit:{review:E4}}=Qt,ii=({loggedInUser:e,isControllerOrReviewer:n,allUsers:r,isMonthEnd:i,auditReportGroup:a,groupIdWithActiveStatus:d,ruleGroup:l,setGroupIdWithActiveStatus:c,onClickRetryGroupFetch:p,onClickRule:m,handleReasonAuditRule:x})=>{const
|
|
5297
|
+
`,Qt=t.appLocale.getLocalizedStrings(),{cockpit:{review:E4}}=Qt,ii=({loggedInUser:e,isControllerOrReviewer:n,allUsers:r,isMonthEnd:i,auditReportGroup:a,groupIdWithActiveStatus:d,ruleGroup:l,setGroupIdWithActiveStatus:c,onClickRetryGroupFetch:p,onClickRule:m,handleReasonAuditRule:x})=>{const g=a.fetchState,h=g==="In-Progress"&&d[l.auditRuleGroupId].isActive===!0,j=(g==="Completed"||g==="Error")&&d[l.auditRuleGroupId].isActive===!0,b=!a.auditReport?.auditRulesGroupReport[0]?.isSuccess,C=w4(j,h,l,a),S=()=>{const f=d[l.auditRuleGroupId];g==="Completed"&&c({...d,[l.auditRuleGroupId]:{...f,isGroupExpanded:!f.isGroupExpanded}})},y=()=>{p(a.auditReportGroupId)};return o.jsxRuntimeExports.jsxs(v4,{isGroupActive:j,isGroupLoading:h,isAnyIssueInReportGroup:b,groupFetchState:g,isGroupExpanded:d[l.auditRuleGroupId].isGroupExpanded,isFirst:d[l.auditRuleGroupId].isFirst,isLast:d[l.auditRuleGroupId].isLast,children:[o.jsxRuntimeExports.jsxs(k4,{onClick:S,children:[h?o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Small",style:{display:"flex"},start:!0}):j?b?o.jsxRuntimeExports.jsx(ai,{}):g==="Error"?o.jsxRuntimeExports.jsx(ai,{}):o.jsxRuntimeExports.jsx(D4,{}):o.jsxRuntimeExports.jsx(O4,{}),o.jsxRuntimeExports.jsxs(T4,{children:[o.jsxRuntimeExports.jsx(I4,{isGroupActive:j,isGroupLoading:h,isAnyIssueInReportGroup:b,groupFetchState:g,children:C}),j?g==="Completed"&&(a.auditReport?.auditRulesGroupReport[0]?.auditRules.length??0)>0?d[l.auditRuleGroupId].isGroupExpanded?o.jsxRuntimeExports.jsx(P4,{isAnyIssueInReportGroup:b}):o.jsxRuntimeExports.jsx(L4,{isAnyIssueInReportGroup:b}):o.jsxRuntimeExports.jsx(t.Button,{label:Qt.common.retry,onClick:y,variant:"outline",buttonColors:{borderColor:{default:t.Colors.neutralGrey2Light,hover:t.Colors.primaryLight,disabled:t.Colors.neutralGrey2Light},backgroundColor:{default:"transparent",hover:"transparent",disabled:"transparent"},textColor:{default:t.Colors.heroLight,hover:t.Colors.primaryLight,disabled:t.Colors.heroLight}},style:{padding:`${t.Space.sp1} ${t.Space.sp3}`,borderRadius:t.Space.sp1,marginBottom:"-2px",marginTop:"-2px"},textStyle:{...t.textStyles.smallRegular.cssObject}}):null]})]}),d[l.auditRuleGroupId].isGroupExpanded?o.jsxRuntimeExports.jsx(A4,{children:a.auditReport?.auditRulesGroupReport.map(f=>f.auditRules.map(E=>o.jsxRuntimeExports.jsx(S4,{loggedInUser:e,isControllerOrReviewer:n,allUsers:r,isMonthEnd:i,rule:E,isGroupFixed:!b,ruleGroup:l,onClickRule:m,handleReasonAuditRule:x},E.auditRuleId)))}):null]})},w4=(e,n,r,i)=>{if(e){if(i.fetchState==="Error")return`${Qt.cockpit.errorMessages.auditReportFetchError} ${r.auditRuleGroupDescription.toLocaleLowerCase()}`;if(i.fetchState==="Completed"){const a=ja(i.auditReport?.auditRulesGroupReport[0]?.auditRules);return i.auditReport?.auditRulesGroupReport[0].isSuccess===!0?r.auditRuleGroupDescription:`${r.auditRuleGroupDescription} (${a})`}return Qt.common.strings.empty}else return(n?E4.auditReportDrawer.reviewing:Qt.common.review)+Qt.common.strings.space+r.auditRuleGroupDescription.toLocaleLowerCase()},ja=e=>e?.filter(r=>r.isSuccess===!1)?.length??0,v4=s.div`
|
|
5298
5298
|
display: flex;
|
|
5299
5299
|
background-color: ${e=>e.isGroupActive&&(e.groupFetchState==="Error"||e.isAnyIssueInReportGroup)?t.Colors.alertLight:e.theme.colors.grey5};
|
|
5300
5300
|
border: ${e=>`1px solid ${e.theme.colors.grey3}`};
|
|
@@ -5354,7 +5354,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
5354
5354
|
width: ${t.Space.sp4};
|
|
5355
5355
|
height: ${t.Space.sp4};
|
|
5356
5356
|
color: ${e=>e.theme.colors.grey2};
|
|
5357
|
-
`,xs={navBarHeight:new t.ResponsiveSized(62,62,62),navBarPaddingLeft:new t.ResponsiveSized(t.sp[3],t.sp[3],t.sp[8]),navBarPaddingRight:new t.ResponsiveSized(t.sp[3],t.sp[3],t.sp[8])},{cockpit:{review:jo},dateFormat:os,timeFormat:N4,common:M4}=t.appLocale.getLocalizedStrings(),z4=({isAuditScoreCompleted:e,auditRuleGroups:n,loggedInUser:r,isMonthEnd:i,auditReportGroupView:a,allUsers:d,reviewCompanyView:l,style:c,analytics:p,handleFetchAuditReportGroupView:m,handleGenerateAuditReport:x,handleCancelIconClick:
|
|
5357
|
+
`,xs={navBarHeight:new t.ResponsiveSized(62,62,62),navBarPaddingLeft:new t.ResponsiveSized(t.sp[3],t.sp[3],t.sp[8]),navBarPaddingRight:new t.ResponsiveSized(t.sp[3],t.sp[3],t.sp[8])},{cockpit:{review:jo},dateFormat:os,timeFormat:N4,common:M4}=t.appLocale.getLocalizedStrings(),z4=({isAuditScoreCompleted:e,auditRuleGroups:n,loggedInUser:r,isMonthEnd:i,auditReportGroupView:a,allUsers:d,reviewCompanyView:l,style:c,analytics:p,handleFetchAuditReportGroupView:m,handleGenerateAuditReport:x,handleCancelIconClick:g,handleRuleClick:h,handleReasonAuditRule:j})=>{const b=t.useWindowSizeContext(),[C,S]=u.useState(ns(n,1)),[y,f]=u.useState({id:n[0]?.auditRuleGroupId,index:0}),[E,R]=u.useState(!1),[I,A]=u.useState(1),[v,T]=u.useState(!1),[F,D]=u.useState(null),K=u.useMemo(()=>l?.controllers.map(k=>`${k.user.firstName} ${k.user.middleName} ${k.user.lastName}`)??[],[l?.controllers]),M={fixesRequired:0,totalChecks:0,auditScorePercentage:0,bypassedAuditScore:0,auditReportLastGeneratedDate:null};u.useEffect(()=>{a.auditReportGroups.forEach(k=>{a.auditReportGroups.forEach(z=>{z.auditReportGroupId===y.id&&(z.fetchState==="Completed"||z.fetchState==="Error")&&f({id:n[y.index+1]?.auditRuleGroupId,index:y.index+1})});const O=k.auditReport?.auditRulesGroupReport.find(z=>z.auditRuleGroupId===k.auditReportGroupId);(k.fetchState==="Completed"&&y.id===k.auditReportGroupId&&C[k.auditReportGroupId].isActive===!0&&O?.sequence===I||k.fetchState==="Error"&&y.id===k.auditReportGroupId)&&(A(I+1),S(ns(n,I+1)))})},[a.auditReportGroups,I,n,C]),u.useEffect(()=>{if(a.auditReportGroups.filter(Z=>Z.fetchState==="In-Progress").length===0&&R(!0),a.auditReportGroups.filter(Z=>Z.fetchState==="Completed"||Z.fetchState==="Error").length===n.length){T(!0);let Z=0;a.auditReportGroups.forEach(Q=>{Z=Z+ja(Q.auditReport?.auditRulesGroupReport[0]?.auditRules)});const ie=F4(a),N=J.dateNow().startOf("month").subtract(1,"date").format(os.analytics.MMMYYYYFormat),H=l?.customerGroup,L=Math.ceil(a.auditReportGroups[0].auditReport?.auditSummary.auditScorePercentage??0);p.trackAuditScorePercentage(J.dateNow().format(os.analytics.MMSlashDDSlashYYYYFormat),N,L,l?.name??"",ie,Z,K,H??null)}const z=a.auditReportGroups.find(Z=>Z.fetchState==="Completed");z?.auditReport?.status?.lastRefreshSuccessTime!=null&&D(z)},[a.auditReportGroups,n.length,p,l,a,K]);const Y=()=>{S(ns(n,1)),f({id:n[0]?.auditRuleGroupId,index:0}),R(!1),A(1),T(!1),D(null)},G=()=>{Y();const k=n.map(O=>O.auditRuleGroupId);x(k)},w=()=>{g()},P=k=>{m(k)},B=(k,O,z)=>{p.trackAuditIssuesClicked(z,l?.name??"",K,J.dateNow().format(os.analytics.MMSlashDDSlashYYYYFormat)),h(k,O)};return o.jsxRuntimeExports.jsxs(B4,{style:c,children:[o.jsxRuntimeExports.jsx(U4,{windowSize:b,style:c,children:o.jsxRuntimeExports.jsx(H4,{children:o.jsxRuntimeExports.jsxs(K4,{windowSize:b,children:[o.jsxRuntimeExports.jsx(_4,{}),o.jsxRuntimeExports.jsxs(G4,{children:[o.jsxRuntimeExports.jsx(Y4,{children:l?.name}),o.jsxRuntimeExports.jsx(Z4,{children:v?F?.auditReport?.status?.lastRefreshSuccessTime?.utc(!0).local().format(N4.hmmADashDDMMMCommaYYYY):M4.strings.empty})]}),o.jsxRuntimeExports.jsxs(q4,{children:[o.jsxRuntimeExports.jsxs(X4,{isGenerateClickEnabled:E,onClick:G,children:[o.jsxRuntimeExports.jsx(J4,{}),o.jsxRuntimeExports.jsx(Q4,{children:jo.auditReportDrawer.updateScore})]}),o.jsxRuntimeExports.jsx(eR,{onClick:w,children:o.jsxRuntimeExports.jsx(tR,{})})]})]})})}),o.jsxRuntimeExports.jsxs(W4,{children:[o.jsxRuntimeExports.jsx(V4,{children:o.jsxRuntimeExports.jsx(Nb,{auditSummaryData:l!=null?l.auditSummary:M,isAuditScoreLoadingCompleted:v&&e,isMonthEnd:i})}),o.jsxRuntimeExports.jsxs(li,{children:[o.jsxRuntimeExports.jsx(ci,{children:jo.auditReportDrawer.Business}),o.jsxRuntimeExports.jsx(di,{children:n.filter(k=>k.ruleType===jo.auditReportDrawer.Business.toLowerCase()).map(k=>{const O=a.auditReportGroups.find(z=>z.auditReportGroupId===k.auditRuleGroupId);return O!=null&&Object.keys(C).length>0?o.jsxRuntimeExports.jsx(ii,{loggedInUser:r,isControllerOrReviewer:a.isControllerOrReviewer,allUsers:d,isMonthEnd:i,ruleGroup:k,groupIdWithActiveStatus:C,auditReportGroup:O,setGroupIdWithActiveStatus:S,onClickRetryGroupFetch:P,onClickRule:B,handleReasonAuditRule:j},k.auditRuleGroupId):null})})]}),o.jsxRuntimeExports.jsxs(li,{children:[o.jsxRuntimeExports.jsx(ci,{children:jo.auditReportDrawer.Accounting}),o.jsxRuntimeExports.jsx(di,{children:n.filter(k=>k.ruleType===jo.auditReportDrawer.Accounting.toLowerCase()).map(k=>{const O=a.auditReportGroups.find(z=>z.auditReportGroupId===k.auditRuleGroupId);return O!=null&&Object.keys(C).length>0?o.jsxRuntimeExports.jsx(ii,{loggedInUser:r,isControllerOrReviewer:a.isControllerOrReviewer,allUsers:d,isMonthEnd:i,ruleGroup:k,groupIdWithActiveStatus:C,auditReportGroup:O,setGroupIdWithActiveStatus:S,onClickRetryGroupFetch:P,onClickRule:B,handleReasonAuditRule:j},k.auditRuleGroupId):null})})]})]})]})},ns=(e,n)=>{const r={},i={};return e.forEach(a=>{const{ruleType:d,sequence:l}=a;i[d]===void 0?i[d]={first:l,last:l}:(l<i[d].first&&(i[d].first=l),l>i[d].last&&(i[d].last=l))}),e.forEach(a=>{const{auditRuleGroupId:d,ruleType:l,sequence:c}=a,p=c<=n,m=c===i[l].first,x=c===i[l].last;r[d]={isActive:p,isGroupExpanded:!1,isFirst:m,isLast:x}}),r},F4=e=>e.auditReportGroups.filter(r=>r.auditReport?.auditRulesGroupReport[0].isSuccess===!1).map(r=>r.auditReportGroupId),B4=s.div`
|
|
5358
5358
|
display: flex;
|
|
5359
5359
|
flex-direction: column;
|
|
5360
5360
|
align-items: center;
|
|
@@ -5460,8 +5460,8 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
5460
5460
|
`,tR=s(t.SvgClose)`
|
|
5461
5461
|
width: ${t.Space.sp3};
|
|
5462
5462
|
height: ${t.Space.sp3};
|
|
5463
|
-
`,ne=t.appLocale.getLocalizedStrings(),$o={navBarHeight:new t.ResponsiveSized(62,62,62),navBarPaddingLeft:new t.ResponsiveSized(t.sp[3],t.sp[3],t.sp[8]),navBarPaddingRight:new t.ResponsiveSized(t.sp[3],t.sp[3],t.sp[8]),navBarPaddingTop:new t.ResponsiveSized(12,12,t.sp[3]),navBarPaddingBottom:new t.ResponsiveSized(12,12,19)},oR={title:new t.ResponsiveSizedStyle("extraLargeMedium","extraLargeSemiBold")},nR=({companyView:e,allUsers:n,onRetryBankAccountConnection:r,onCloseClick:i})=>{const a=t.useWindowSizeContext(),d=e!=null?J.getAuditWarningsCount(e):0,l=e?.onboardingInfo?.bankAccountLinked,c=e?.onboardingInfo?.qboLinked,p=e?.onboardingInfo?.identityVerified,m=e?.onboardingInfo?.businessVerified,x=e?.onboardingInfo?.accountingConnectionCreationMode==="zeni_user",
|
|
5464
|
-
${t.capitaliseWords(ne.cockpit.review.warningsDrawer.issueFound)}`})}),
|
|
5463
|
+
`,ne=t.appLocale.getLocalizedStrings(),$o={navBarHeight:new t.ResponsiveSized(62,62,62),navBarPaddingLeft:new t.ResponsiveSized(t.sp[3],t.sp[3],t.sp[8]),navBarPaddingRight:new t.ResponsiveSized(t.sp[3],t.sp[3],t.sp[8]),navBarPaddingTop:new t.ResponsiveSized(12,12,t.sp[3]),navBarPaddingBottom:new t.ResponsiveSized(12,12,19)},oR={title:new t.ResponsiveSizedStyle("extraLargeMedium","extraLargeSemiBold")},nR=({companyView:e,allUsers:n,onRetryBankAccountConnection:r,onCloseClick:i})=>{const a=t.useWindowSizeContext(),d=e!=null?J.getAuditWarningsCount(e):0,l=e?.onboardingInfo?.bankAccountLinked,c=e?.onboardingInfo?.qboLinked,p=e?.onboardingInfo?.identityVerified,m=e?.onboardingInfo?.businessVerified,x=e?.onboardingInfo?.accountingConnectionCreationMode==="zeni_user",g=[];if(l!=null){const h=n.find(C=>C.userId===l.userIds[0]),{errorMessage:j,successMessage:b}=sR(l,x,h);g.push({status:j!=null?"Error":b!=null?"Complete":"Incomplete",userInfo:h,message:j??b??`${ne.cockpit.onboarding.header.linkBankAccount} ${ne.common.strings.hyphen} ${ne.common.incompleteText}`,onClickRetry:r})}if(c!=null){const h=n.find(C=>C.userId===c.userIds[0]),{errorMessage:j,successMessage:b}=rR(c,x,h);g.push({status:j!=null?"Error":b!=null?"Complete":"Incomplete",userInfo:h,message:j??b??`${ne.cockpit.onboarding.header.connectToQBO} ${ne.common.strings.hyphen} ${ne.common.incompleteText}`})}if(p!=null){const h=n.find(C=>C.userId===p.userIds[0]),{errorMessage:j,successMessage:b}=iR(p,x,h);g.push({status:j!=null?"Error":b!=null?"Complete":"Incomplete",userInfo:h,message:j??b??`${ne.cockpit.review.warningsDrawer.kyc} ${ne.common.strings.hyphen} ${p.status}`})}if(m!=null){const h=n.find(C=>C.userId===m.userIds[0]),{errorMessage:j,successMessage:b}=aR(m,x,h);g.push({status:j!=null?"Error":b!=null?"Complete":"Incomplete",userInfo:h,message:j??b??`${ne.cockpit.review.warningsDrawer.kyb} ${ne.common.strings.hyphen} ${m.status}`})}return o.jsxRuntimeExports.jsxs(lR,{children:[o.jsxRuntimeExports.jsx(cR,{windowSize:a,children:o.jsxRuntimeExports.jsx(dR,{children:o.jsxRuntimeExports.jsxs(mR,{windowSize:a,children:[o.jsxRuntimeExports.jsx(xR,{windowSize:a,children:e?.name}),o.jsxRuntimeExports.jsx(bR,{onClick:i,children:o.jsxRuntimeExports.jsx(RR,{})})]})})}),o.jsxRuntimeExports.jsxs(pR,{children:[o.jsxRuntimeExports.jsx(uR,{children:d>0?o.jsxRuntimeExports.jsxs(ss,{children:[o.jsxRuntimeExports.jsx(ss,{children:t.capitaliseWords(ne.cockpit.review.warningsDrawer.issueFound)}),o.jsxRuntimeExports.jsx($R,{children:`${ne.common.strings.openingBrace}${d}${ne.common.strings.closingBrace}`})]}):o.jsxRuntimeExports.jsx(ss,{children:`${ne.common.no}
|
|
5464
|
+
${t.capitaliseWords(ne.cockpit.review.warningsDrawer.issueFound)}`})}),g.map((h,j)=>o.jsxRuntimeExports.jsx(hR,{isStepInError:h.status==="Error",children:o.jsxRuntimeExports.jsxs(gR,{children:[o.jsxRuntimeExports.jsx(SR,{children:h.status==="Complete"?o.jsxRuntimeExports.jsx(CR,{}):h.status==="Error"?o.jsxRuntimeExports.jsx(t.SvgHighImportanceFilled,{}):o.jsxRuntimeExports.jsx(jR,{})}),o.jsxRuntimeExports.jsxs(yR,{children:[o.jsxRuntimeExports.jsx(fR,{isStepInError:h.status==="Error",children:h.message}),h.status==="Error"?o.jsxRuntimeExports.jsx(t.Button,{label:ne.common.retry,onClick:h.onClickRetry,loading:e?.retryBankAccountConnectionFetchState.fetchState==="In-Progress",variant:"outline",style:{padding:`${t.Space.sp1} ${t.Space.sp3}`,borderRadius:t.Space.sp1},textStyle:{...t.textStyles.smallMedium.cssObject}}):null]})]})},j))]})]})},sR=(e,n,r)=>{const i=e.error===!0?e.errorDetails!=null?e.errorDetails.summary:ne.cockpit.review.errors.bankAccountLinked:null,a=e.completed===!0?r!=null?`${ne.cockpit.onboarding.header.linkBankAccount} ${ne.common.strings.hyphen} ${n===!0?`${ne.common.via} ${ne.common.cockpit} `:ne.common.strings.empty}${ne.common.by} ${r.firstName} ${r.lastName}`:ne.cockpit.onboarding.header.linkBankAccount:null;return{errorMessage:i,successMessage:a}},rR=(e,n,r)=>{const i=e.error===!0?e.errorDetails!=null?e.errorDetails.summary:ne.cockpit.review.errors.qboLinked:null,a=e.completed===!0?r!=null?`${ne.cockpit.onboarding.header.connectToQBO} ${ne.common.strings.hyphen} ${n===!0?`${ne.common.via} ${ne.common.cockpit} `:ne.common.strings.empty}${ne.common.by} ${r.firstName} ${r.lastName}`:`${ne.cockpit.onboarding.header.connectToQBO}`:null;return{errorMessage:i,successMessage:a}},iR=(e,n,r)=>{const i=e.status==="Error"?r!=null?`${ne.cockpit.review.warningsDrawer.kyc} ${ne.common.failed.toLocaleLowerCase()} ${ne.common.strings.hyphen} ${n===!0?`${ne.common.via} ${ne.common.cockpit} `:ne.common.strings.empty}${ne.common.by} ${r.firstName} ${r.lastName}`:`${ne.cockpit.review.warningsDrawer.kyc} ${ne.common.failed.toLocaleLowerCase()}`:null,a=e.status==="Complete"?r!=null?`${ne.cockpit.review.warningsDrawer.kyc} ${ne.cockpit.review.warningsDrawer.identity} ${ne.common.strings.hyphen} ${n===!0?`${ne.common.via} ${ne.common.cockpit} `:ne.common.strings.empty}${ne.common.by} ${r.firstName} ${r.lastName}`:`${ne.cockpit.review.warningsDrawer.kyc} ${ne.cockpit.review.warningsDrawer.identity}`:null;return{errorMessage:i,successMessage:a}},aR=(e,n,r)=>{const i=e.status==="Error"?r!=null?`${ne.cockpit.review.warningsDrawer.kyb} ${ne.common.failed.toLocaleLowerCase()} ${ne.common.strings.hyphen} ${n===!0?`${ne.common.via} ${ne.common.cockpit} `:ne.common.strings.empty}${ne.common.by} ${r.firstName} ${r.lastName}`:`${ne.cockpit.review.warningsDrawer.kyb} ${ne.common.failed.toLocaleLowerCase()}`:null,a=e.status==="Complete"?r!=null?`${ne.cockpit.review.warningsDrawer.kyb} ${ne.cockpit.review.warningsDrawer.identity} ${ne.common.strings.hyphen} ${n===!0?`${ne.common.via} ${ne.common.cockpit} `:ne.common.strings.empty}${ne.common.by} ${r.firstName} ${r.lastName}`:`${ne.cockpit.review.warningsDrawer.kyb} ${ne.cockpit.review.warningsDrawer.identity}`:null;return{errorMessage:i,successMessage:a}},lR=s.div`
|
|
5465
5465
|
display: flex;
|
|
5466
5466
|
flex-direction: column;
|
|
5467
5467
|
padding-top: ${t.Space.sp3};
|
|
@@ -5605,7 +5605,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
5605
5605
|
color: ${({theme:e})=>e.colors.success};
|
|
5606
5606
|
border-color: ${({theme:e})=>e.colors.tagSuccessBg};
|
|
5607
5607
|
}
|
|
5608
|
-
`;function NR({row:e,onAction:n}){const[r,i]=u.useState(!1),[a,d]=u.useState(null),l=u.useRef(null),c=t.appLocale.getLocalizedStrings().cockpit.creditAgent,p=[];if(e.cardStatus==="Pre-approved"?(p.push({label:c.kebabApprove,action:"approve"}),p.push({label:c.kebabResetToDefault,action:"reset"})):e.cardStatus==="Approved"?(p.push({label:c.kebabResetToDefault,action:"reset"}),p.push({label:c.kebabReject,action:"reject",danger:!0})):e.cardStatus==="Active"?p.push({label:c.kebabLock,action:"lock"}):e.cardStatus==="Locked"&&p.push({label:c.kebabUnlock,action:"unlock"}),p.length===0)return null;const m=x=>{if(x.stopPropagation(),l.current){const
|
|
5608
|
+
`;function NR({row:e,onAction:n}){const[r,i]=u.useState(!1),[a,d]=u.useState(null),l=u.useRef(null),c=t.appLocale.getLocalizedStrings().cockpit.creditAgent,p=[];if(e.cardStatus==="Pre-approved"?(p.push({label:c.kebabApprove,action:"approve"}),p.push({label:c.kebabResetToDefault,action:"reset"})):e.cardStatus==="Approved"?(p.push({label:c.kebabResetToDefault,action:"reset"}),p.push({label:c.kebabReject,action:"reject",danger:!0})):e.cardStatus==="Active"?p.push({label:c.kebabLock,action:"lock"}):e.cardStatus==="Locked"&&p.push({label:c.kebabUnlock,action:"unlock"}),p.length===0)return null;const m=x=>{if(x.stopPropagation(),l.current){const g=l.current.getBoundingClientRect();d({top:g.bottom+4,right:window.innerWidth-g.right})}i(g=>!g)};return o.jsxRuntimeExports.jsxs(MR,{children:[o.jsxRuntimeExports.jsx(Eo,{ref:l,title:c.moreActionsTitle,onClick:m,children:o.jsxRuntimeExports.jsx(t.SvgMore,{width:t.Space.sp3,height:t.Space.sp3})}),r&&Lo.createPortal(o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(zR,{onClick:()=>i(!1)}),o.jsxRuntimeExports.jsx(FR,{style:a?{top:a.top,right:a.right}:{visibility:"hidden"},children:p.map(x=>o.jsxRuntimeExports.jsx(BR,{danger:x.danger,onClick:g=>{g.stopPropagation(),i(!1),n(x.action)},children:x.label},x.action))})]}),document.body)]})}const MR=s.span`
|
|
5609
5609
|
position: relative;
|
|
5610
5610
|
`,zR=s.div`
|
|
5611
5611
|
position: fixed;
|
|
@@ -5634,7 +5634,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
5634
5634
|
&:hover {
|
|
5635
5635
|
background: ${({theme:e})=>e.colors.grey4};
|
|
5636
5636
|
}
|
|
5637
|
-
`;function _R({style:e,row:n,isLastRow:r,cardProfilesActions:i,editingNs:a,editingValue:d,onEditStart:l,onEditChange:c,onEditCancel:p,onNoteOpen:m}){const x=t.appLocale.getLocalizedStrings().cockpit.creditAgent,
|
|
5637
|
+
`;function _R({style:e,row:n,isLastRow:r,cardProfilesActions:i,editingNs:a,editingValue:d,onEditStart:l,onEditChange:c,onEditCancel:p,onNoteOpen:m}){const x=t.appLocale.getLocalizedStrings().cockpit.creditAgent,g=t.appLocale.getLocalizedStrings().dateFormat.visual.MMMDCommaYYYYformat;return o.jsxRuntimeExports.jsxs(GR,{style:e,children:[o.jsxRuntimeExports.jsx(YR,{$hideBorder:r,children:o.jsxRuntimeExports.jsxs(s$,{children:[n.customerName??n.tenantId??n.tenantEmailDomain,n.isNew&&o.jsxRuntimeExports.jsx(r$,{children:x.newBadge})]})}),o.jsxRuntimeExports.jsx(ZR,{$hideBorder:r,children:n.companyId!=null&&n.companyId!==""?o.jsxRuntimeExports.jsx(UR,{companyId:n.companyId,onOpen:()=>{const h=n.companyId;m({companyId:h,companyName:n.customerName??n.tenantId??n.tenantEmailDomain,roomId:`cockpit_${h}`})}}):o.jsxRuntimeExports.jsx(It,{children:x.dash})}),o.jsxRuntimeExports.jsx(XR,{$hideBorder:r,children:o.jsxRuntimeExports.jsx(i$,{status:n.cardStatus,children:n.cardStatus})}),o.jsxRuntimeExports.jsx(qR,{$hideBorder:r,children:a===n.tenantEmailDomain?o.jsxRuntimeExports.jsxs(a$,{children:[o.jsxRuntimeExports.jsx(l$,{type:"number",min:"0",step:"any",autoFocus:!0,value:d,onChange:h=>c(h.target.value),onKeyDown:h=>{if(h.key==="Enter"){const j=parseFloat(d);!isNaN(j)&&j>=0&&(i.onUpdateProfile(n.tenantEmailDomain,n.tenantId,{creditLimit:j}),p())}else h.key==="Escape"&&p()}}),o.jsxRuntimeExports.jsx(c$,{onClick:()=>{const h=parseFloat(d);!isNaN(h)&&h>=0&&(i.onUpdateProfile(n.tenantEmailDomain,n.tenantId,{creditLimit:h}),p())},children:o.jsxRuntimeExports.jsx(t.SvgTick,{width:t.Space.sp3,height:t.Space.sp3})}),o.jsxRuntimeExports.jsx(d$,{onClick:p,children:o.jsxRuntimeExports.jsx(t.SvgClose,{width:t.Space.sp3,height:t.Space.sp3})})]}):n.creditLimit!=null?o.jsxRuntimeExports.jsxs(pi,{onClick:()=>{l(n.tenantEmailDomain,String(n.creditLimit??""))},children:["$",t.appLocale.numberFormatter().format(n.creditLimit??0)]}):o.jsxRuntimeExports.jsx(pi,{onClick:()=>{l(n.tenantEmailDomain,"")},children:x.addLimit})}),o.jsxRuntimeExports.jsx(QR,{$hideBorder:r,children:n.isAnalyzing?o.jsxRuntimeExports.jsx(It,{children:x.inProgress}):o.jsxRuntimeExports.jsx(wR,{score:n.creditScore})}),o.jsxRuntimeExports.jsx(JR,{$hideBorder:r,children:n.isAnalyzing?o.jsxRuntimeExports.jsx(It,{children:x.inProgress}):n.recommendedAmount!=null?o.jsxRuntimeExports.jsx(p$,{children:t.currencyAmountCompactFormatter(n.recommendedAmount)}):o.jsxRuntimeExports.jsx(It,{children:x.pending})}),o.jsxRuntimeExports.jsx(e$,{$hideBorder:r,children:n.isAnalyzing?o.jsxRuntimeExports.jsx(It,{children:x.inProgress}):n.rationale!=null?o.jsxRuntimeExports.jsx(VR,{text:n.rationale}):o.jsxRuntimeExports.jsx(It,{children:x.dash})}),o.jsxRuntimeExports.jsx(t$,{$hideBorder:r,children:n.isAnalyzing?o.jsxRuntimeExports.jsx(It,{children:x.inProgress}):n.reportDate!=null?n.reportDate.format(g):"—"}),o.jsxRuntimeExports.jsx(o$,{$hideBorder:r,children:o.jsxRuntimeExports.jsxs(h$,{children:[o.jsxRuntimeExports.jsx(t.EntityAvatar,{name:n.updatedByName??x.creditAgentFallback}),o.jsxRuntimeExports.jsxs(g$,{children:[o.jsxRuntimeExports.jsx(S$,{children:n.updatedByName??x.creditAgentFallback}),n.updatedOn!=null&&o.jsxRuntimeExports.jsx(y$,{children:n.updatedOn.format(g)})]})]})}),o.jsxRuntimeExports.jsx(n$,{$hideBorder:r,children:o.jsxRuntimeExports.jsx(WR,{row:n,cardProfilesActions:i})})]})}function WR({row:e,cardProfilesActions:n}){const[r,i]=u.useState(null),[a,d]=u.useState(!1),l=u.useRef(null),c=t.appLocale.getLocalizedStrings().cockpit.creditAgent;u.useEffect(()=>()=>{l.current!=null&&clearTimeout(l.current)},[]);const p=n.onAnalyse?o.jsxRuntimeExports.jsx(Eo,{title:e.tenantId?c.analyseTitle:c.tenantIdNotAvailable,disabled:!e.tenantId,onClick:()=>e.tenantId!=null&&n.onAnalyse?.(e.tenantId),children:o.jsxRuntimeExports.jsx(t.SvgPlayButtonSmall,{width:t.Space.sp3,height:t.Space.sp3})}):null,m=C=>{const S=C??"";if(r==="pre-approve")n.onUpdateProfile(e.tenantEmailDomain,e.tenantId,{cardStatus:"Pre-approved",reason:S});else if(r==="approve")n.onUpdateProfile(e.tenantEmailDomain,e.tenantId,{cardStatus:"Approved",reason:S});else if(r==="reject")n.onUpdateProfile(e.tenantEmailDomain,e.tenantId,{cardStatus:"Rejected",reason:S});else if(r==="lock")n.onUpdateProfile(e.tenantEmailDomain,e.tenantId,{cardStatus:"Locked",reason:S});else if(r==="unlock")n.onUpdateProfile(e.tenantEmailDomain,e.tenantId,{cardStatus:"Active",reason:S});else if(r==="reset"){const y=e.cardStatus==="Pre-approved"?"Not-Initiated":"Interested";n.onUpdateProfile(e.tenantEmailDomain,e.tenantId,{cardStatus:y,reason:S})}i(null)},x=u.useCallback(C=>{C==="approve"?i("approve"):C==="reject"?i("reject"):C==="reset"?i("reset"):C==="lock"?i("lock"):C==="unlock"&&i("unlock")},[]),g=e.customerName??e.tenantEmailDomain,h=e.creditLimit!=null?t.currencyAmountCompactFormatter(e.creditLimit):"",j=r?HR(r,g,h,c):null,b={onOkClick:C=>m(C),onCancelClick:()=>{i(null)},onClickAway:()=>{i(null)}};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[r&&j&&o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(R$,{children:j.title}),descriptionComponent:o.jsxRuntimeExports.jsx($$,{children:j.body}),primaryButtonText:j.confirmLabel,proceedButtonVariant:j.confirmVariant,secondaryButtonText:c.cancel,isNotesIncluded:!0,notesPlaceholder:c.addReasonOptional,action:b,containerStyle:{maxWidth:520}}),o.jsxRuntimeExports.jsxs(C$,{children:[p,e.cardStatus==="Interested"&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Eo,{className:"reject",title:c.rejectTitle,onClick:()=>i("reject"),children:o.jsxRuntimeExports.jsx(t.SvgClose,{width:t.Space.sp3,height:t.Space.sp3})}),o.jsxRuntimeExports.jsxs(j$,{children:[o.jsxRuntimeExports.jsx(Eo,{className:"approve",title:e.creditLimit==null?c.setLimitBeforeApproving:c.preApprove,onClick:()=>{if(e.creditLimit==null){d(!0),l.current!=null&&clearTimeout(l.current),l.current=setTimeout(()=>d(!1),3e3);return}i("pre-approve")},children:o.jsxRuntimeExports.jsx(t.SvgTick,{width:t.Space.sp3,height:t.Space.sp3})}),a&&o.jsxRuntimeExports.jsx(b$,{children:c.setCreditLimitFirst})]})]}),e.cardStatus==="Not-Initiated"&&o.jsxRuntimeExports.jsx(Eo,{className:"approve",title:c.moveToInterested,onClick:()=>n.onUpdateProfile(e.tenantEmailDomain,e.tenantId,{cardStatus:"Interested"}),children:o.jsxRuntimeExports.jsx(t.SvgTick,{width:t.Space.sp3,height:t.Space.sp3})}),["Pre-approved","Approved","Active","Locked"].includes(e.cardStatus)&&o.jsxRuntimeExports.jsx(NR,{row:e,onAction:x})]})]})}function VR({text:e}){const n=u.useRef(null),[r,i]=u.useState(null),a=()=>{if(!n.current)return;const d=n.current.getBoundingClientRect(),c=d.top>160+16;i({...c?{bottom:window.innerHeight-d.top+8}:{top:d.bottom+8},left:d.left,above:c})};return o.jsxRuntimeExports.jsxs(u$,{ref:n,onMouseEnter:a,onMouseLeave:()=>i(null),children:[o.jsxRuntimeExports.jsx(m$,{children:e}),r&&Lo.createPortal(o.jsxRuntimeExports.jsx(x$,{style:{position:"fixed",left:r.left,...r.above?{bottom:r.bottom}:{top:r.top}},above:r.above,children:e}),document.body)]})}function UR({companyId:e,onOpen:n}){const{threads:r,isLoading:i}=t.useFilteredThreads({entityType:t.toCollaborationEntityType({tab:"creditAgent",key:"details"}),companyId:e},!1);return o.jsxRuntimeExports.jsxs(f$,{onClick:a=>{a.stopPropagation(),n()},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:r.length,isLoading:i}),o.jsxRuntimeExports.jsx(t.SvgComment,{width:t.Space.sp3,height:t.Space.sp3})]})}function HR(e,n,r,i){return{"pre-approve":{title:i.modalPreApproveTitle,body:`${n} ${i.modalCardAccessBodySuffix} ${r}.`,confirmLabel:i.modalConfirmLabel,confirmVariant:"primary"},approve:{title:i.modalApproveTitle,body:`${n} ${i.modalCardAccessBodySuffix} ${r}.`,confirmLabel:i.modalConfirmLabel,confirmVariant:"primary"},reject:{title:i.modalRejectTitle,body:`${n} ${i.modalRejectBodySuffix}`,confirmLabel:i.modalConfirmLabel,confirmVariant:"destructive"},lock:{title:i.modalLockTitle,body:`${n}${i.modalLockBodySuffix}`,confirmLabel:i.modalLockLabel,confirmVariant:"destructive"},unlock:{title:i.modalUnlockTitle,body:`${n}${i.modalUnlockBodySuffix}`,confirmLabel:i.modalUnlockLabel,confirmVariant:"primary"},reset:{title:i.modalResetTitle,body:`${n}${i.modalResetBodySuffix}`,confirmLabel:i.modalResetLabel,confirmVariant:"destructive"}}[e]}function KR(e,n){switch(e){case"Interested":return{backgroundColor:n.tagWarningBg,color:n.tagWarningColor};case"Not-Initiated":return{backgroundColor:n.tagDefaultBg,color:n.tagDefaultColor};case"Pre-approved":return{backgroundColor:n.tagInfoBg,color:n.tagInfoColor};case"Approved":return{backgroundColor:n.tagSuccessBg,color:n.tagSuccessColor};case"Enabled":return{backgroundColor:n.tagInfoBg,color:n.tagInfoColor};case"Active":return{backgroundColor:n.tagSuccessBg,color:n.tagSuccessColor};case"Rejected":return{backgroundColor:n.tagAttentionBg,color:n.tagAttentionColor};case"Locked":return{backgroundColor:n.tagDefaultBg,color:n.tagDefaultColor};default:return{backgroundColor:n.tagDefaultBg,color:n.tagDefaultColor}}}const GR=s.div`
|
|
5638
5638
|
display: flex;
|
|
5639
5639
|
flex-direction: row;
|
|
5640
5640
|
align-items: stretch;
|
|
@@ -5830,7 +5830,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
5830
5830
|
`,$$=s(t.StandardRegularSp)`
|
|
5831
5831
|
color: ${({theme:e})=>e.colors.grey1};
|
|
5832
5832
|
line-height: 1.5;
|
|
5833
|
-
`;function E$({cardProfilesData:e,cardProfilesActions:n,onUIStateChange:r,uiState:i}){const a=t.appLocale.getLocalizedStrings().cockpit.creditAgent,d=u.useMemo(()=>OR(a),[a]),[l,c]=u.useState(null),[p,m]=u.useState(""),[x,
|
|
5833
|
+
`;function E$({cardProfilesData:e,cardProfilesActions:n,onUIStateChange:r,uiState:i}){const a=t.appLocale.getLocalizedStrings().cockpit.creditAgent,d=u.useMemo(()=>OR(a),[a]),[l,c]=u.useState(null),[p,m]=u.useState(""),[x,g]=u.useState(null),h=i.sortKey??null,j=i.sortDir,b=i.filterText,C=e.fetchState==="Not-Started"||e.fetchState==="In-Progress",S=R=>{r(h===R?{sortDir:j==="asc"?"desc":"asc"}:{sortKey:R,sortDir:"asc"})},y=e.rows,f=y.length,E=u.useMemo(()=>({cardProfilesActions:n,editingNs:l,editingValue:p,onEditCancel:()=>c(null),onEditChange:m,onEditStart:(R,I)=>{c(R),m(I)},onNoteOpen:g,rowCount:y.length,rows:y}),[n,l,p,y]);return o.jsxRuntimeExports.jsxs(v$,{children:[o.jsxRuntimeExports.jsxs(z$,{children:[o.jsxRuntimeExports.jsxs(F$,{children:[o.jsxRuntimeExports.jsx(B$,{children:o.jsxRuntimeExports.jsx(t.SvgSearch,{width:t.Space.sp3,height:t.Space.sp3})}),o.jsxRuntimeExports.jsx(_$,{placeholder:a.searchPlaceholder,value:b,onChange:R=>r({filterText:R.target.value})}),!!b&&o.jsxRuntimeExports.jsx(W$,{onClick:()=>r({filterText:""}),children:o.jsxRuntimeExports.jsx(t.SvgClose,{width:t.Space.sp3,height:t.Space.sp3})})]}),!C&&o.jsxRuntimeExports.jsxs(V$,{children:[f," ",f!==1?a.tenantCountPlural:a.tenantCountSingular,b?` ${a.tenantCountFound}`:""]})]}),e.fetchState==="Error"?o.jsxRuntimeExports.jsx(M$,{children:a.failedToLoadCardProfiles}):o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(k$,{children:[o.jsxRuntimeExports.jsx(T$,{children:d.map(R=>{const I=R.sortable&&h===R.key,A=j;return o.jsxRuntimeExports.jsx(L$,{$width:R.width,$justifyContent:R.justifyContent,$growToFill:R.growToFill,children:o.jsxRuntimeExports.jsx(P$,{children:R.sortable?o.jsxRuntimeExports.jsxs(I$,{type:"button",$active:I,onClick:()=>S(R.key),children:[R.label,o.jsxRuntimeExports.jsx(A$,{$direction:I?A:"asc",children:o.jsxRuntimeExports.jsx(t.SvgArrowTailTop,{width:ko.sortIconSize,height:ko.sortIconSize})})]}):R.label})},R.key)})}),C?o.jsxRuntimeExports.jsx(O$,{children:o.jsxRuntimeExports.jsx(t.ListTableSkeleton,{colPcts:AR,rowCount:DR})}):y.length===0?o.jsxRuntimeExports.jsx(N$,{children:b||i.focus!=="All"||i.minScore>0?a.noTenantsMatchFilters:a.noCardProfilesYet}):o.jsxRuntimeExports.jsx(D$,{children:o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:R,width:I})=>o.jsxRuntimeExports.jsx(o.FixedSizeList,{height:R,width:I,itemCount:y.length,itemSize:ko.rowHeightPx,itemData:E,innerElementType:w$,overscanCount:5,children:ba})})})]}),x!=null&&o.jsxRuntimeExports.jsx(Xe.RoomProvider,{id:x.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${x.companyName} ${a.noteDrawerTitleSuffix}`,filter:{application:"cockpit",companyId:x.companyId,entityType:t.toCollaborationEntityType({tab:"creditAgent",key:"details"}),isGlobalComment:!1,tab:"creditAgent"},isLoading:!1,threadMetadata:{companyName:x.companyName,companyId:x.companyId,entityId:x.companyId,entityType:t.toCollaborationEntityType({tab:"creditAgent",key:"details"}),isGlobalComment:!1,application:"cockpit",tab:"creditAgent",url:window.location.href},textOverrides:{composerPlaceholder:a.composerPlaceholder,replyComposerPlaceholder:a.replyComposerPlaceholder},onThreadClick:()=>null,onCloseAllThreadsDrawer:()=>g(null)})})]})]})}const ba=u.memo(({index:e,style:n,data:r})=>{const i=r.rows[e],a=e===r.rowCount-1;return o.jsxRuntimeExports.jsx(_R,{style:n,row:i,isLastRow:a,cardProfilesActions:r.cardProfilesActions,editingNs:r.editingNs,editingValue:r.editingValue,onEditStart:r.onEditStart,onEditChange:r.onEditChange,onEditCancel:r.onEditCancel,onNoteOpen:r.onNoteOpen})});ba.displayName="CreditAgentListItem";const w$=u.forwardRef(({style:e,...n},r)=>o.jsxRuntimeExports.jsx("div",{ref:r,style:{...e,position:"relative"},...n})),v$=s.div`
|
|
5834
5834
|
display: flex;
|
|
5835
5835
|
flex-direction: column;
|
|
5836
5836
|
flex: 1;
|
|
@@ -5962,7 +5962,7 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
5962
5962
|
}
|
|
5963
5963
|
`,V$=s(t.SmallMediumSp)`
|
|
5964
5964
|
color: ${e=>e.theme.colors.hero};
|
|
5965
|
-
`,U$=["All","New only","Interested","Active only"],H$=e=>{const{creditAgent:n}=t.appLocale.getLocalizedStrings().cockpit;switch(e){case"All":return n.focusAll;case"New only":return n.focusNewOnly;case"Interested":return n.focusInterested;case"Active only":return n.focusActiveOnly}};function K$({headerActions:e,headerData:n,creditAgentPageData:r,creditAgentPageActions:i}){const a=t.appLocale.getLocalizedStrings().cockpit.creditAgent,d=t.useWindowSizeContext(),{macroData:l,cardProfilesData:c}=r,{onFetchMacro:p,onSaveMacro:m,onResetSaveMacro:x,onUIStateChange:
|
|
5965
|
+
`,U$=["All","New only","Interested","Active only"],H$=e=>{const{creditAgent:n}=t.appLocale.getLocalizedStrings().cockpit;switch(e){case"All":return n.focusAll;case"New only":return n.focusNewOnly;case"Interested":return n.focusInterested;case"Active only":return n.focusActiveOnly}};function K$({headerActions:e,headerData:n,creditAgentPageData:r,creditAgentPageActions:i}){const a=t.appLocale.getLocalizedStrings().cockpit.creditAgent,d=t.useWindowSizeContext(),{macroData:l,cardProfilesData:c}=r,{onFetchMacro:p,onSaveMacro:m,onResetSaveMacro:x,onUIStateChange:g,cardProfilesActions:h}=i,{onDownloadReport:j}=h,[b,C]=u.useState(""),[S,y]=u.useState(!1),{focus:f,minScore:E}=c.uiState;u.useEffect(()=>{l.fetchState==="Not-Started"&&p()},[l.fetchState,p]),u.useEffect(()=>{l.data!=null&&!S&&C(l.data.instructions)},[l.data,S]),u.useEffect(()=>{l.updateState==="Completed"&&(y(!1),x())},[l.updateState,x]),u.useEffect(()=>{c.fetchState==="Not-Started"&&h.onFetch()},[c.fetchState,h]);const R=u.useCallback(()=>{m(b)},[m,b]),I=u.useCallback(()=>{y(!1),l.data!=null&&C(l.data.instructions),l.updateState==="Error"&&x()},[l.data,l.updateState,x]);return o.jsxRuntimeExports.jsxs(G$,{children:[o.jsxRuntimeExports.jsx(dt,{headerActions:e,headerData:{...n,allTabOptions:n.allTabOptions??rt,selectedTabOption:"creditAgent"}}),o.jsxRuntimeExports.jsxs(Y$,{windowSize:d,children:[o.jsxRuntimeExports.jsxs(Z$,{children:[o.jsxRuntimeExports.jsx(X$,{}),o.jsxRuntimeExports.jsxs(q$,{children:[S&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(t.Button,{variant:"secondary",size:"small",label:a.cancel,onClick:I}),o.jsxRuntimeExports.jsx(t.Button,{variant:"primary",size:"small",label:l.updateState==="In-Progress"?a.saving:a.savePrompt,disabled:l.updateState==="In-Progress",onClick:R})]}),o.jsxRuntimeExports.jsx(t.Button,{variant:"secondary",size:"small",label:a.downloadReport,onClick:j})]})]}),o.jsxRuntimeExports.jsxs(Q$,{children:[o.jsxRuntimeExports.jsxs(J$,{children:[o.jsxRuntimeExports.jsxs(e5,{children:[o.jsxRuntimeExports.jsx(t5,{children:"✦"}),l.fetchState==="In-Progress"?o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Standard",start:!0}):o.jsxRuntimeExports.jsx(o5,{value:b,disabled:l.updateState==="In-Progress",onChange:A=>{C(A.target.value),y(!0)},placeholder:a.promptPlaceholder,rows:6})]}),o.jsxRuntimeExports.jsxs(n5,{children:[o.jsxRuntimeExports.jsxs(ui,{children:[o.jsxRuntimeExports.jsx(mi,{children:a.focusLabel}),o.jsxRuntimeExports.jsx(s5,{children:U$.map(A=>o.jsxRuntimeExports.jsx(r5,{active:f===A,onClick:()=>g({focus:A}),children:H$(A)},A))})]}),o.jsxRuntimeExports.jsx(i5,{}),o.jsxRuntimeExports.jsxs(ui,{children:[o.jsxRuntimeExports.jsx(mi,{children:a.minScoreLabel}),o.jsxRuntimeExports.jsx(a5,{type:"range",min:0,max:100,value:E,onChange:A=>g({minScore:parseInt(A.target.value)})}),o.jsxRuntimeExports.jsx(l5,{children:E})]})]})]}),l.updateState==="Error"&&o.jsxRuntimeExports.jsx(d5,{children:a.failedToSavePrompt})]}),o.jsxRuntimeExports.jsx(c5,{children:o.jsxRuntimeExports.jsx(E$,{cardProfilesData:c,cardProfilesActions:h,onUIStateChange:g,uiState:c.uiState})})]})]})}const G$=s.div`
|
|
5966
5966
|
height: calc(100vh - 45px);
|
|
5967
5967
|
overflow: hidden;
|
|
5968
5968
|
background-color: ${e=>e.theme.colors.grey4};
|
|
@@ -6085,4 +6085,4 @@ ${e}`,Ad=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
6085
6085
|
`,d5=s(t.SmallRegularP)`
|
|
6086
6086
|
color: ${e=>e.theme.colors.alert};
|
|
6087
6087
|
margin-top: ${t.Space.sp2};
|
|
6088
|
-
`;exports.AIAgentsActivatingPage=t.AIAgentsActivatingPage;exports.AIIconButton=t.AIIconButton;exports.AIPerformancePage=t.AIPerformancePage;exports.ALL_AI_CFO_MENU_OPTIONS=t.ALL_AI_CFO_MENU_OPTIONS;exports.ALL_SETTINGS_MENU_OPTIONS=t.ALL_SETTINGS_MENU_OPTIONS;exports.APP_DRAWER_CONTENT_WIDTH_PX=t.APP_DRAWER_CONTENT_WIDTH_PX;exports.AccountInfoPage=t.AccountInfoPage;exports.AccountLockedInfoModal=t.AccountLockedInfoModal;exports.AccountReconDetailsDrawerPage=t.AccountReconDetailsDrawerPage;exports.ActivityIndicator=t.ActivityIndicator;exports.AddAddressForCardDrawer=t.AddAddressForCardDrawer;exports.AddToWalletPage=t.AddToWalletPage;exports.AddressFormPage=t.AddressFormPage;exports.AgingReportsPage=t.AgingReportsPage;exports.AiCfoChatHeader=t.AiCfoChatHeader;exports.AiCfoMenuContent=t.AiCfoMenuContent;exports.AiCfoOnboardingPage=t.AiCfoOnboardingPage;exports.AiCfoPage=t.AiCfoPage;exports.AiCfoScopeModal=t.AiCfoScopeModal;exports.AiCfoScopeModalScrollBody=t.AiCfoScopeModalScrollBody;exports.AiCfoSidePanel=t.AiCfoSidePanel;exports.AiFinanceTeamReadyPage=t.AiFinanceTeamReadyPage;exports.AllowBlockChipPicker=t.AllowBlockChipPicker;exports.AnalyticsOnLoad=t.AnalyticsOnLoad;exports.ApAgingDetailPage=t.ApAgingDetailPage;exports.AppBasePage=t.AppBasePage;exports.AppDrawerContent=t.AppDrawerContent;exports.AppDrawerHeightMobile=t.AppDrawerHeightMobile;exports.ApprovalRulesSettingsPage=t.ApprovalRulesSettingsPage;exports.ArAgingDetailPage=t.ArAgingDetailPage;exports.AskAiCfoNavButton=t.AskAiCfoNavButton;exports.AskAiCfoNavButtonWhenEnabled=t.AskAiCfoNavButtonWhenEnabled;exports.AttachmentView=t.AttachmentView;exports.AutoSweepFlow=t.AutoSweepFlow;exports.AutoTransferRulePage=t.AutoTransferRulePage;exports.BackNavigationProvider=t.BackNavigationProvider;exports.BankConnectionsSettingsPage=t.BankConnectionsSettingsPage;exports.BillDetailPage=t.BillDetailPage;exports.BillDetailPageSkeleton=t.BillDetailPageSkeleton;exports.BillPayApprovalRuleDetailPage=t.BillPayApprovalRuleDetailPage;exports.BillPayApprovalRuleDetailPageV1=t.BillPayApprovalRuleDetailPage$1;exports.BillPayApprovalRulesPage=t.BillPayApprovalRulesPage;exports.BillPayApprovalRulesPageV1=t.BillPayApprovalRulesPage$1;exports.BillPayPromoPage=t.BillPayPromoPage;exports.BillPaySetUpLoading=t.SpendManagementSetUpLoading;exports.BillPaySetUpPage=t.BillPaySetUpPage;exports.BillingSettingsPage=t.BillingSettingsPage;exports.BillsBulkReviewDrawerPage=t.BillsBulkReviewDrawerPage;exports.BusinessVerificationPage=t.BusinessVerificationPage;exports.CARD_POLICY_LIMIT_ROW_ID_REQUIRE_RECEIPT=t.CARD_POLICY_LIMIT_ROW_ID_REQUIRE_RECEIPT;exports.CARD_POLICY_LIMIT_ROW_ID_TRANSACTION=t.CARD_POLICY_LIMIT_ROW_ID_TRANSACTION;exports.COMMAND_CENTER_SUBMENU_TYPES=t.COMMAND_CENTER_SUBMENU_TYPES;exports.CapitalizationOnboardingPopup=t.CapitalizationOnboardingPopup;exports.CapitalizationSettingsSection=t.CapitalizationSettingsSection;exports.CardPolicyCreatePage=t.CardPolicyCreatePage;exports.CardPolicyEditPage=t.CardPolicyEditPage;exports.CardPolicyFormPageSkeleton=t.CardPolicyFormPageSkeleton;exports.CardPolicyFormSections=t.CardPolicyFormSections;exports.CardPolicyListPage=t.CardPolicyListPage;exports.CardPolicyListPageSkeleton=t.CardPolicyListPageSkeleton;exports.CardPolicyListRow=t.CardPolicyListRow;exports.CardPolicyListSkeletonRow=t.CardPolicyListSkeletonRow;exports.CardPolicyManualEmptyState=t.CardPolicyManualEmptyState;exports.CardsAiCfoHero=t.CardsAiCfoHero;exports.CardsShutdownBanner=t.CardsShutdownBanner;exports.CashManagementBanner=t.CashManagementBanner;exports.CashManagementNavCTA=t.CashManagementNavCTA;exports.CashOverview=t.CashOverview;exports.CashbackDetailLoading=t.CashbackDetailLoading;exports.CashbackDetailPage=t.CashbackDetailPage;exports.ChargeCardCVVActivate=t.ChargeCardCVVActivate;exports.ChargeCardDetailLoading=t.ChargeCardDetailLoading;exports.ChargeCardDetailPage=t.ChargeCardDetailPage;exports.ChargeCardListLoading=t.ChargeCardListLoading;exports.ChargeCardListPage=t.ChargeCardListPage;exports.ChargeCardListSkeletonRow=t.ChargeCardListSkeletonRow;exports.ChargeCardPaymentHistoryPage=t.ChargeCardPaymentHistoryPage;exports.ChargeCardPromoPage=t.ChargeCardPromoPage;exports.ChargeCardPromoPageSkeleton=t.ChargeCardPromoPageSkeleton;exports.ChargeCardSetUpPage=t.ChargeCardSetUpPage;exports.ChargeCardSetupLoading=t.SpendManagementSetUpLoading;exports.ChargeCardStatementsLoading=t.ChargeCardStatementsLoading;exports.ChargeCardStatementsPage=t.ChargeCardStatementsPage;exports.ChargeCardUserOnboardingPromoPage=t.ChargeCardUserOnboardingPromoPage;exports.ChargeCardUserOnboardingPromoPageSkeleton=t.ChargeCardUserOnboardingPromoPageSkeleton;exports.CheckDepositDrawerPage=t.CheckDepositDrawerPage;exports.ClickableRow=t.ClickableRow;exports.CollaborationGlobalStyles=t.CollaborationGlobalStyles;exports.CollaborationProvider=t.CollaborationProvider;exports.CollaborationRoomProvider=t.CollaborationRoomProvider;exports.Colors=t.Colors;exports.CommentsAndNotesCount=t.CommentsAndNotesCount;exports.CommentsDrawerProvider=t.CommentsDrawerProvider;exports.CompanyOfficerOnboardingDetailsSection=t.CompanyOfficerOnboardingDetailsSection;exports.CompanyOnboardingDetailsSection=t.CompanyOnboardingDetailsSection;exports.CompanyPassportCard=t.CompanyPassportCard;exports.CompanyPassportPage=t.CompanyPassportPage;exports.CompleteProfile=t.CompleteProfile;exports.ConfettiBurst=t.ConfettiBurst;exports.ConfirmationPopup=t.ConfirmationPopup;exports.ConnectDataSourcesPage=t.ConnectDataSourcesPage;exports.CreateOrEditVendorPage=t.CreateOrEditVendorPage;exports.CreateOrEditVendorPageSkeleton=t.CreateOrEditVendorPageSkeleton;exports.CreatedEntitiesAnswer=t.CreatedEntitiesAnswer;exports.CreatingEntitiesAnswerLoading=t.CreatingEntitiesAnswerLoading;exports.CreditCardPaymentDrawerPage=t.CreditCardPaymentDrawerPage;exports.CustomerOnboardingContainerPage=t.CustomerOnboardingContainerPage;exports.CustomerOnboardingNoStepsPage=t.CustomerOnboardingNoStepsPage;exports.CustomerOnboardingPage=t.CustomerOnboardingPage;exports.CustomerOnboardingProductSuitePage=t.CustomerOnboardingProductSuitePage;exports.Dashboard=t.Dashboard;exports.DashboardReportPage=t.DashboardReportPage;exports.DashboardSidebarLogoAnimation=t.DashboardSidebarLogoAnimation;exports.DataListTable=t.DataListTable;exports.DataListTableHeader=t.DataListTableHeader;exports.DataListTableRow=t.DataListTableRow;exports.DataListTableSortIndicator=t.DataListTableSortIndicator;exports.DebitCardSetPin=t.DebitCardSetPin;exports.DropdownPortalContext=t.DropdownPortalContext;exports.EditPeoplePage=t.EditPeoplePage;exports.EditReimbursementDetailPage=t.EditReimbursementDetailPage;exports.EditableBillDetailPage=t.EditableBillDetailPage;exports.EntityDetailPage=t.EntityDetailPage;exports.ErrorBoundaryWrapper=t.ErrorBoundaryWrapper;exports.ExcludedAccountReconDetailsDrawerPage=t.ExcludedAccountReconDetailsDrawerPage;exports.ExpenseAutomationOverviewPage=t.ExpenseAutomationOverviewPage;exports.ExpenseAutomationOverviewPageSkeleton=t.ExpenseAutomationOverviewPageSkeleton;exports.ExpenseAutomationPage=t.ExpenseAutomationPage;exports.ExpressPayPage=t.ExpressPayPage;exports.FeatureDynamicConfigNames=t.DynamicConfigNames;exports.FeatureGatesNames=t.FeatureGatesNames;exports.FeaturePreviewPage=t.FeaturePreviewPage;exports.FeatureProvider=t.FeatureProvider;exports.FirstReviewVendorDetailPage=t.FirstReviewVendorDetailPage;exports.FontWeight=t.FontWeight;exports.GlobalInfoProvider=t.GlobalInfoProvider;exports.GlobalReviewListPage=t.GlobalReviewListPage;exports.InformationCardStack=t.InformationCardStack;exports.InitialCollaborationProvider=t.InitialCollaborationProvider;exports.InsightsCardStack=t.InsightCardStack;exports.IntegrationsSection=t.IntegrationsSection;exports.IntegrationsSettingsPage=t.IntegrationsSettingsPage;exports.InternationalWireVerificationPage=t.InternationalWireVerificationPage;exports.InviteFormPage=t.InviteFormPage;exports.InvitePageListView=t.InvitePageListView;exports.InvitePeoplePage=t.InvitePeoplePage;exports.InvoiceUploadSection=t.InvoiceUploadSection;exports.InvoiceUploadSectionSkeleton=t.InvoiceUploadSectionSkeleton;exports.IssueChargeCardPage=t.IssueChargeCardPage;exports.IssueChargeCardPageSkeleton=t.IssueChargeCardPageSkeleton;exports.LinkBillExpensePage=t.LinkBillExpensePage;exports.LinkJETransactionPage=t.LinkJETransactionPage;exports.Loader=t.Loader;exports.LogoutButton=t.LogoutButton;exports.MCC_CHIP_ID_PREFIX=t.MCC_CHIP_ID_PREFIX;exports.MagicLinkDomesticWireDetailsPage=t.MagicLinkDomesticWireDetailsPage;exports.MagicLinkInternationalWireDetailsPage=t.MagicLinkInternationalWireDetailsPage;exports.MagicLinkSuccessPage=t.MagicLinkSuccessPage;exports.MagicLinkVendorACHDetailsPage=t.MagicLinkVendorACHDetailsPage;exports.Modal=t.Modal;exports.MonthEndEmailDrawerCustomerRequestPage=t.MonthEndEmailDrawerCustomerRequestPage;exports.MyBankConnectionsSettingsPage=t.MyBankConnectionsSettingsPage;exports.MyPendingActivationChargeCardListPage=t.MyPendingActivationChargeCardListPage;exports.MyProfileSettingsPage=t.MyProfileSettingsPage;exports.NavBar=t.NavBar;exports.NavBarRightRowStyled=t.NavBarRightRowStyled;exports.NewGlobalMerchantPage=t.NewGlobalMerchantPage;exports.NewUpdateAvailablePage=t.NewUpdateAvailablePage;exports.NotFoundPage=t.NotFoundPage;exports.NotificationIcon=t.SvgNotification;exports.NotificationSettingsPage=t.NotificationSettingsPage;exports.NotificationsPage=t.NotificationsPage;exports.OAuthConsentPage=t.OAuthConsentPage;exports.OnboardingInitialLoader=t.OnboardingInitialLoader;exports.OnboardingSidebar=t.OnboardingSidebar;exports.OnboardingStepFrame=t.OnboardingStepFrame;exports.OpExByVendorPage=t.OpExByVendorPage;exports.OverlayContainerPage=t.OverlayContainerPage;exports.PandLWithForecastPage=t.PandLWithForecastPage;exports.PanelInternalContext=t.PanelInternalContext;exports.PaymentAccountSetupBillingAddressSection=t.PaymentAccountSetupBillingAddressSection;exports.PeoplePage=t.PeoplePage;exports.Picker=t.Picker;exports.PolicyLimitsRowList=t.PolicyLimitsRowList;exports.PolicyModeSelector=t.PolicyModeSelector;exports.PortfolioAllocationFormPage=t.PortfolioAllocationFormPage;exports.QBOConnectionDialog=t.QBOConnectionDialog;exports.QBOSetupSectionWithForm=t.QBOSetupSectionWithForm;exports.QuickResponsesPage=t.QuickResponsesPage;exports.QuickViewModeContext=t.QuickViewModeContext;exports.RIGHT_SIDE_PANEL_WIDTH_PX=t.RIGHT_SIDE_PANEL_WIDTH_PX;exports.ReferralDrawerPage=t.DrawerPage;exports.ReimbursementApprovalRuleDetailPage=t.ReimbursementApprovalRuleDetailPage;exports.ReimbursementApprovalRuleDetailPageV1=t.ReimbursementApprovalRuleDetailPage$1;exports.ReimbursementApprovalRulesPage=t.ReimbursementApprovalRulesPage;exports.ReimbursementApprovalRulesPageV1=t.ReimbursementApprovalRulesPage$1;exports.ReimbursementDetailPage=t.ReimbursementDetailPage;exports.ReimbursementDetailPageSkeleton=t.ReimbursementDetailPageSkeleton;exports.ReimbursementPromoPage=t.ReimbursementPromoPage;exports.ReimbursementSetUpLoading=t.SpendManagementSetUpLoading;exports.ReimbursementSetUpPage=t.RemiSetupPage;exports.RemisBulkReviewDrawerPage=t.ReimbursementsBulkReviewDrawerPage;exports.ReportsPage=t.ReportsPage;exports.ResponsiveSized=t.ResponsiveSized;exports.ReviewBillDetailsPage=t.ReviewBillDetailsPage;exports.ReviewConfirmTransferPanel=t.ReviewConfirmTransferPanel;exports.ReviewDetailsPageSkeleton=t.ReviewDetailsPageSkeleton;exports.ScheduleDetailSkeleton=t.ScheduleDetailSkeleton;exports.ScheduleDetailsAccruedExpensesPage=t.ScheduleDetailsAccruedExpensesPage;exports.ScheduleDetailsFixedAssetsPage=t.ScheduleDetailsFixedAssetsPage;exports.ScheduleDetailsPage=t.ScheduleDetailsPage;exports.SchedulePanelInternalContext=t.SchedulePanelInternalContext;exports.SearchableCheckboxCardList=t.SearchableCheckboxCardList;exports.SessionTimeoutPopup=t.SessionTimeoutPopup;exports.SidePanelContext=t.SidePanelContext;exports.SidePanelProvider=t.SidePanelProvider;exports.SignIn=t.SignIn;exports.SomethingWrongPage=t.SomethingWrongPage;exports.Space=t.Space;exports.SpendManagementListLoading=t.SpendManagementListLoading;exports.SpendManagementListViewPage=t.SpendManagementListViewPage;exports.StatementsPage=t.StatementsPage;exports.StyledCapsule=t.StyledCapsule;exports.SubscriptionDetailPage=t.SubscriptionDetailPage;exports.SubscriptionSummaryPage=t.SubscriptionSummaryPage;exports.SyntheticAiCfoAnswerView=t.SyntheticAiCfoAnswerView;exports.TaskDetailPage=t.TaskDetailPage;exports.TaskManagementPage=t.TaskManagementPage;exports.TenantsDropDown=t.TenantsDropDown;exports.TextStyle=t.TextStyle;exports.ToolkitProvider=t.ToolkitProvider;exports.TopExDetailPage=t.TopExDetailPage;exports.TransactionActivityLogPage=t.TransactionActivityLogPage;exports.TransactionActivityLogPanel=t.TransactionActivityLogPanel;exports.TransactionDetailPage=t.TransactionDetailPage;exports.TransactionDetailSkeleton=t.TransactionDetailSkeleton;exports.TransactionListBig=t.TransactionListBig;exports.TransactionListPage=t.TransactionListPage;exports.TransactionPanelInternalContext=t.TransactionPanelInternalContext;exports.TransactionSidePanelLayout=t.TransactionSidePanelLayout;exports.TransactionVendorDetailPage=t.TransactionVendorDetailPage;exports.TransferDrawerPage=t.TransferDrawerPage;exports.TreasuryOverviewPage=t.TreasuryOverviewPage;exports.TreasuryPromoPage=t.TreasuryPromoPage;exports.TreasurySetUpPage=t.TreasurySetUpPage;exports.TreasuryStatementsPage=t.TreasuryStatementsPage;exports.TreasuryTaxLetterPage=t.TreasuryTaxLetterPage;exports.TreasuryTransferOrReviewPage=t.TreasuryTransferOrReviewPage;exports.TrendChart=t.TrendChart;exports.UncategorizedAccountsMappingPage=t.UncategorizedAccountsMappingPage;exports.UnitIntegrationPage=t.UnitIntegrationPage;exports.VENDOR_CHIP_ID_PREFIX=t.VENDOR_CHIP_ID_PREFIX;exports.Vendor2FAPopup=t.Vendor2FAPopup;exports.VendorACHDetailsPage=t.VendorACHDetailsPage;exports.VendorAccruedSchedulesPage=t.VendorAccruedSchedulesPage;exports.VendorDetailPage=t.VendorDetailPage;exports.VendorDomesticWireDetailsPage=t.VendorDomesticWireDetailsPage;exports.VendorFiling1099DetailsEditablePage=t.VendorFiling1099DetailsEditablePage;exports.VendorFiling1099EditableFormSkeleton=t.VendorFiling1099EditableFormSkeleton;exports.VendorFiling1099ListPage=t.VendorFiling1099ListPage;exports.VendorFirstReviewPage=t.VendorFirstReviewPage;exports.VendorInternationalSwiftBasedDetailsPage=t.VendorInternationalSwiftBasedDetailsPage;exports.VendorInternationalWireDetailsPage=t.VendorInternationalWireDetailsPage;exports.VendorListPage=t.VendorListPage;exports.VendorSchedulesPage=t.VendorSchedulesPage;exports.VerificationFrame=t.VerificationFrame;exports.VerifyDevice=t.VerifyDevice;exports.VerifyUnlockFinancialStackPage=t.VerifyUnlockFinancialStackPage;exports.WebV2MicroService=t.WebV2MicroService;exports.WebV2MicroServiceProvider=t.WebV2MicroServiceProvider;exports.WelcomeAnimation=t.WelcomeAnimation;exports.WindowSizeProvider=t.WindowSizeProvider;exports.ZeniAccountDetailLoading=t.ZeniAccountDetailLoading;exports.ZeniAccountDetailNavBarTitleShimmer=t.ZeniAccountDetailNavBarTitleShimmer;exports.ZeniAccountDetailPage=t.ZeniAccountDetailPage;exports.ZeniAccountListLoading=t.ZeniAccountListLoading;exports.ZeniAccountListViewPage=t.ZeniAccountListViewPage;exports.ZeniAccountPromoPage=t.ZeniAccountPromoPage;exports.ZeniAccountSetUpPage=t.ZeniAccountSetUpPage;exports.ZeniText=t.ZeniText;exports.ZeniThemeProvider=t.ZeniThemeProvider;exports.alignToJustify=t.alignToJustify;exports.amountToString=t.amountToString;exports.amountValueToString=t.amountValueToString;exports.appLocale=t.appLocale;exports.applyExtractedPolicyRulesToFormValues=t.applyExtractedPolicyRulesToFormValues;exports.buildBulkCreateCardPolicyTemplateRequestsFromInteractiveForm=t.buildBulkCreateCardPolicyTemplateRequestsFromInteractiveForm;exports.buildCardPolicyFormValuesFromRequest=t.buildCardPolicyFormValuesFromRequest;exports.buildCreateCardPolicyTemplateRequest=t.buildCreateCardPolicyTemplateRequest;exports.buildCreateCardPolicyTemplateRequestFromInteractiveForm=t.buildCreateCardPolicyTemplateRequestFromInteractiveForm;exports.buildMccCategoryChipId=t.buildMccCategoryChipId;exports.buildStickyKeySet=t.buildStickyKeySet;exports.buildVendorChipId=t.buildVendorChipId;exports.cellVerticalAlignToFlexAlign=t.cellVerticalAlignToFlexAlign;exports.clearAutoLogoutContext=t.clearAutoLogoutContext;exports.clickableRowStyles=t.clickableRowStyles;exports.computeStickyLeftOffsets=t.computeStickyLeftOffsets;exports.darkColors=t.darkColors;exports.darkTheme=t.darkTheme;exports.dashboardCardDimension=t.designDimension;exports.defaultCardPolicyFormValues=t.defaultCardPolicyFormValues;exports.getAlpha2=t.getAlpha2;exports.getAlpha3=t.getAlpha3;exports.getColorForALabel=t.getColorForALabel;exports.getCountries=t.getCountries;exports.getCustomerDataFromAutoComplete=t.getCustomerDataFromAutoComplete;exports.getFullName=t.getFullName;exports.getInitialOpenThreadRequestFromSearch=t.getInitialOpenThreadRequestFromSearch;exports.getRecipientTotalAmount=t.getRecipientTotalAmount;exports.getShowNegativeAmountInParenthesisDefaultValue=t.getShowNegativeAmountInParenthesisDefaultValue;exports.getShowNegativeAmountInParenthesisForPercentDefaultValue=t.getShowNegativeAmountInParenthesisForPercentDefaultValue;exports.getStableTransactionId=t.getStableTransactionId;exports.isCloseManagementMenu=t.isCloseManagementMenu;exports.isClosedCardStatus=t.isClosedCardStatus;exports.isCollaborationEntityType=t.isCollaborationEntityType;exports.isMobileOrTabletView=t.isMobileOrTabletView;exports.isMobilePhoneScreen=t.isMobilePhoneScreen;exports.lightColors=t.lightColors;exports.lightTheme=t.lightTheme;exports.mergeColumnDeclarativeWithRenderers=t.mergeColumnDeclarativeWithRenderers;exports.mergeLayoutDefaults=t.mergeLayoutDefaults;exports.percentValueToString=t.percentValueToString;exports.resolveColumnWidth=t.resolveColumnWidth;exports.roundAmountIfNeeded=t.roundAmountIfNeeded;exports.roundOffNumberToTwoDecimal=t.roundOffNumberToTwoDecimal;exports.setAutoLogoutContext=t.setAutoLogoutContext;exports.setShowNegativeAmountInParenthesisDefaultValue=t.setShowNegativeAmountInParenthesisDefaultValue;exports.setShowNegativeAmountInParenthesisForPercentDefaultValue=t.setShowNegativeAmountInParenthesisForPercentDefaultValue;exports.sp=t.sp;exports.textAlignForCell=t.textAlignForCell;exports.textStyles=t.textStyles;exports.toInstitutionLogoDataUri=t.toInstitutionLogoDataUri;exports.toMccCategoryChipFieldValue=t.toMccCategoryChipFieldValue;exports.toMenuOptionType=t.toMenuOptionType;exports.toSettingsMenuOptionTypeStrict=t.toSettingsMenuOptionTypeStrict;exports.toSupportedLocaleStrict=t.toSupportedLocaleStrict;exports.toVendorChipFieldValue=t.toVendorChipFieldValue;exports.trackTreasuryTransferAnalytics=t.trackTreasuryTransferAnalytics;exports.uploadAttachmentReceipts=t.uploadAttachmentReceipts;exports.useApprovalRulesV3Config=t.useApprovalRulesV3Config;exports.useBackNavigation=t.useBackNavigation;exports.useCollaborationInfoContext=t.useCollaborationInfoContext;exports.useCommentsDrawer=t.useCommentsDrawer;exports.useDropdownPortal=t.useDropdownPortal;exports.useExpenseAutomationEnabledForUser=t.useExpenseAutomationEnabledForUser;exports.useGlobalInfoContext=t.useGlobalInfoContext;exports.useLockBodyScroll=t.useLockBodyScroll;exports.usePanelInternal=t.usePanelInternal;exports.usePrevious=t.usePrevious;exports.useQuickViewMode=t.useQuickViewMode;exports.useRegisterBackHandler=t.useRegisterBackHandler;exports.useRequestCloseAllCommentDrawers=t.useRequestCloseAllCommentDrawers;exports.useSchedulePanelInternal=t.useSchedulePanelInternal;exports.useSessionAutoLogoutConfig=t.useSessionAutoLogoutConfig;exports.useSidePanelContext=t.useSidePanelContext;exports.useToolkitContext=t.useToolkitContext;exports.useTransactionPanelInternal=t.useTransactionPanelInternal;exports.useWindowSizeContext=t.useWindowSizeContext;exports.useZeniCardsVisibilityConfig=t.useZeniCardsVisibilityConfig;exports.useZeniFeatureContext=t.useZeniFeatureContext;exports.useZeniThemeContext=t.useZeniThemeContext;exports.waitFor=t.waitFor;exports.useZeniTheme=o.useTheme;exports.zeniStyled=o.styled;exports.zeniEmotionStyled=s;exports.AiAccountantDetailDrawer=Ey;exports.AiAccountantPage=Xf;exports.AuditReportDrawerPage=z4;exports.COCKPIT_TAB_OPTIONS=rt;exports.COCKPIT_TAB_OPTIONS_WITH_CREDIT_AGENT=qa;exports.CockpitNavBar=wl;exports.CreditAgentPage=K$;exports.HealthMonitorDetailDrawer=ux;exports.HealthMonitorPage=Vh;exports.ManagementPage=wu;exports.MonthEndReportHistoricDataPage=y3;exports.MonthEndReportPage=Qj;exports.NavHeader=dt;exports.OnboardingCustomerPage=XC;exports.OnboardingPage=k2;exports.PortfolioPage=fy;exports.ReviewPage=Rb;exports.SubscriptionAddPlanPage=jS;exports.SubscriptionPage=Qg;exports.SubscriptionUpdatePlanPage=sS;exports.TaskManagerPage=Zu;exports.WarningsDrawerPage=nR;exports.toCockpitOptionType=Rt;exports.toCockpitOptionTypeStrict=vl;
|
|
6088
|
+
`;exports.AIAgentsActivatingPage=t.AIAgentsActivatingPage;exports.AIIconButton=t.AIIconButton;exports.AIPerformancePage=t.AIPerformancePage;exports.ALL_AI_CFO_MENU_OPTIONS=t.ALL_AI_CFO_MENU_OPTIONS;exports.ALL_SETTINGS_MENU_OPTIONS=t.ALL_SETTINGS_MENU_OPTIONS;exports.APP_DRAWER_CONTENT_WIDTH_PX=t.APP_DRAWER_CONTENT_WIDTH_PX;exports.AccountInfoPage=t.AccountInfoPage;exports.AccountLockedInfoModal=t.AccountLockedInfoModal;exports.AccountReconDetailsDrawerPage=t.AccountReconDetailsDrawerPage;exports.AccountReconDetailsDrawerPageV2=t.AccountReconDetailsDrawerPage$1;exports.ActivityIndicator=t.ActivityIndicator;exports.AddAddressForCardDrawer=t.AddAddressForCardDrawer;exports.AddToWalletPage=t.AddToWalletPage;exports.AddressFormPage=t.AddressFormPage;exports.AgingReportsPage=t.AgingReportsPage;exports.AiCfoChatHeader=t.AiCfoChatHeader;exports.AiCfoMenuContent=t.AiCfoMenuContent;exports.AiCfoOnboardingPage=t.AiCfoOnboardingPage;exports.AiCfoPage=t.AiCfoPage;exports.AiCfoScopeModal=t.AiCfoScopeModal;exports.AiCfoScopeModalScrollBody=t.AiCfoScopeModalScrollBody;exports.AiCfoSidePanel=t.AiCfoSidePanel;exports.AiFinanceTeamReadyPage=t.AiFinanceTeamReadyPage;exports.AllowBlockChipPicker=t.AllowBlockChipPicker;exports.AnalyticsOnLoad=t.AnalyticsOnLoad;exports.ApAgingDetailPage=t.ApAgingDetailPage;exports.AppBasePage=t.AppBasePage;exports.AppDrawerContent=t.AppDrawerContent;exports.AppDrawerHeightMobile=t.AppDrawerHeightMobile;exports.ApprovalRulesSettingsPage=t.ApprovalRulesSettingsPage;exports.ArAgingDetailPage=t.ArAgingDetailPage;exports.AskAiCfoNavButton=t.AskAiCfoNavButton;exports.AskAiCfoNavButtonWhenEnabled=t.AskAiCfoNavButtonWhenEnabled;exports.AttachmentView=t.AttachmentView;exports.AutoSweepFlow=t.AutoSweepFlow;exports.AutoTransferRulePage=t.AutoTransferRulePage;exports.BackNavigationProvider=t.BackNavigationProvider;exports.BankConnectionsSettingsPage=t.BankConnectionsSettingsPage;exports.BillDetailPage=t.BillDetailPage;exports.BillDetailPageSkeleton=t.BillDetailPageSkeleton;exports.BillPayApprovalRuleDetailPage=t.BillPayApprovalRuleDetailPage;exports.BillPayApprovalRuleDetailPageV1=t.BillPayApprovalRuleDetailPage$1;exports.BillPayApprovalRulesPage=t.BillPayApprovalRulesPage;exports.BillPayApprovalRulesPageV1=t.BillPayApprovalRulesPage$1;exports.BillPayPromoPage=t.BillPayPromoPage;exports.BillPaySetUpLoading=t.SpendManagementSetUpLoading;exports.BillPaySetUpPage=t.BillPaySetUpPage;exports.BillingSettingsPage=t.BillingSettingsPage;exports.BillsBulkReviewDrawerPage=t.BillsBulkReviewDrawerPage;exports.BusinessVerificationPage=t.BusinessVerificationPage;exports.CARD_POLICY_LIMIT_ROW_ID_REQUIRE_RECEIPT=t.CARD_POLICY_LIMIT_ROW_ID_REQUIRE_RECEIPT;exports.CARD_POLICY_LIMIT_ROW_ID_TRANSACTION=t.CARD_POLICY_LIMIT_ROW_ID_TRANSACTION;exports.COMMAND_CENTER_SUBMENU_TYPES=t.COMMAND_CENTER_SUBMENU_TYPES;exports.CapitalizationOnboardingPopup=t.CapitalizationOnboardingPopup;exports.CapitalizationSettingsSection=t.CapitalizationSettingsSection;exports.CardPolicyCreatePage=t.CardPolicyCreatePage;exports.CardPolicyEditPage=t.CardPolicyEditPage;exports.CardPolicyFormPageSkeleton=t.CardPolicyFormPageSkeleton;exports.CardPolicyFormSections=t.CardPolicyFormSections;exports.CardPolicyListPage=t.CardPolicyListPage;exports.CardPolicyListPageSkeleton=t.CardPolicyListPageSkeleton;exports.CardPolicyListRow=t.CardPolicyListRow;exports.CardPolicyListSkeletonRow=t.CardPolicyListSkeletonRow;exports.CardPolicyManualEmptyState=t.CardPolicyManualEmptyState;exports.CardsAiCfoHero=t.CardsAiCfoHero;exports.CardsShutdownBanner=t.CardsShutdownBanner;exports.CashManagementBanner=t.CashManagementBanner;exports.CashManagementNavCTA=t.CashManagementNavCTA;exports.CashOverview=t.CashOverview;exports.CashbackDetailLoading=t.CashbackDetailLoading;exports.CashbackDetailPage=t.CashbackDetailPage;exports.ChargeCardCVVActivate=t.ChargeCardCVVActivate;exports.ChargeCardDetailLoading=t.ChargeCardDetailLoading;exports.ChargeCardDetailPage=t.ChargeCardDetailPage;exports.ChargeCardListLoading=t.ChargeCardListLoading;exports.ChargeCardListPage=t.ChargeCardListPage;exports.ChargeCardListSkeletonRow=t.ChargeCardListSkeletonRow;exports.ChargeCardPaymentHistoryPage=t.ChargeCardPaymentHistoryPage;exports.ChargeCardPromoPage=t.ChargeCardPromoPage;exports.ChargeCardPromoPageSkeleton=t.ChargeCardPromoPageSkeleton;exports.ChargeCardSetUpPage=t.ChargeCardSetUpPage;exports.ChargeCardSetupLoading=t.SpendManagementSetUpLoading;exports.ChargeCardStatementsLoading=t.ChargeCardStatementsLoading;exports.ChargeCardStatementsPage=t.ChargeCardStatementsPage;exports.ChargeCardUserOnboardingPromoPage=t.ChargeCardUserOnboardingPromoPage;exports.ChargeCardUserOnboardingPromoPageSkeleton=t.ChargeCardUserOnboardingPromoPageSkeleton;exports.CheckDepositDrawerPage=t.CheckDepositDrawerPage;exports.ClickableRow=t.ClickableRow;exports.CollaborationGlobalStyles=t.CollaborationGlobalStyles;exports.CollaborationProvider=t.CollaborationProvider;exports.CollaborationRoomProvider=t.CollaborationRoomProvider;exports.Colors=t.Colors;exports.CommentsAndNotesCount=t.CommentsAndNotesCount;exports.CommentsDrawerProvider=t.CommentsDrawerProvider;exports.CompanyOfficerOnboardingDetailsSection=t.CompanyOfficerOnboardingDetailsSection;exports.CompanyOnboardingDetailsSection=t.CompanyOnboardingDetailsSection;exports.CompanyPassportCard=t.CompanyPassportCard;exports.CompanyPassportPage=t.CompanyPassportPage;exports.CompleteProfile=t.CompleteProfile;exports.ConfettiBurst=t.ConfettiBurst;exports.ConfirmationPopup=t.ConfirmationPopup;exports.ConnectDataSourcesPage=t.ConnectDataSourcesPage;exports.CreateOrEditVendorPage=t.CreateOrEditVendorPage;exports.CreateOrEditVendorPageSkeleton=t.CreateOrEditVendorPageSkeleton;exports.CreatedEntitiesAnswer=t.CreatedEntitiesAnswer;exports.CreatingEntitiesAnswerLoading=t.CreatingEntitiesAnswerLoading;exports.CreditCardPaymentDrawerPage=t.CreditCardPaymentDrawerPage;exports.CustomerOnboardingContainerPage=t.CustomerOnboardingContainerPage;exports.CustomerOnboardingNoStepsPage=t.CustomerOnboardingNoStepsPage;exports.CustomerOnboardingPage=t.CustomerOnboardingPage;exports.CustomerOnboardingProductSuitePage=t.CustomerOnboardingProductSuitePage;exports.Dashboard=t.Dashboard;exports.DashboardReportPage=t.DashboardReportPage;exports.DashboardSidebarLogoAnimation=t.DashboardSidebarLogoAnimation;exports.DataListTable=t.DataListTable;exports.DataListTableHeader=t.DataListTableHeader;exports.DataListTableRow=t.DataListTableRow;exports.DataListTableSortIndicator=t.DataListTableSortIndicator;exports.DebitCardSetPin=t.DebitCardSetPin;exports.DropdownPortalContext=t.DropdownPortalContext;exports.EditPeoplePage=t.EditPeoplePage;exports.EditReimbursementDetailPage=t.EditReimbursementDetailPage;exports.EditableBillDetailPage=t.EditableBillDetailPage;exports.EntityDetailPage=t.EntityDetailPage;exports.ErrorBoundaryWrapper=t.ErrorBoundaryWrapper;exports.ExcludedAccountReconDetailsDrawerPage=t.ExcludedAccountReconDetailsDrawerPage;exports.ExpenseAutomationOverviewPage=t.ExpenseAutomationOverviewPage;exports.ExpenseAutomationOverviewPageSkeleton=t.ExpenseAutomationOverviewPageSkeleton;exports.ExpenseAutomationPage=t.ExpenseAutomationPage;exports.ExpressPayPage=t.ExpressPayPage;exports.FeatureDynamicConfigNames=t.DynamicConfigNames;exports.FeatureGatesNames=t.FeatureGatesNames;exports.FeaturePreviewPage=t.FeaturePreviewPage;exports.FeatureProvider=t.FeatureProvider;exports.FirstReviewVendorDetailPage=t.FirstReviewVendorDetailPage;exports.FontWeight=t.FontWeight;exports.GlobalInfoProvider=t.GlobalInfoProvider;exports.GlobalReviewListPage=t.GlobalReviewListPage;exports.InformationCardStack=t.InformationCardStack;exports.InitialCollaborationProvider=t.InitialCollaborationProvider;exports.InsightsCardStack=t.InsightCardStack;exports.IntegrationsSection=t.IntegrationsSection;exports.IntegrationsSettingsPage=t.IntegrationsSettingsPage;exports.InternationalWireVerificationPage=t.InternationalWireVerificationPage;exports.InviteFormPage=t.InviteFormPage;exports.InvitePageListView=t.InvitePageListView;exports.InvitePeoplePage=t.InvitePeoplePage;exports.InvoiceUploadSection=t.InvoiceUploadSection;exports.InvoiceUploadSectionSkeleton=t.InvoiceUploadSectionSkeleton;exports.IssueChargeCardPage=t.IssueChargeCardPage;exports.IssueChargeCardPageSkeleton=t.IssueChargeCardPageSkeleton;exports.LinkBillExpensePage=t.LinkBillExpensePage;exports.LinkJETransactionPage=t.LinkJETransactionPage;exports.Loader=t.Loader;exports.LogoutButton=t.LogoutButton;exports.MCC_CHIP_ID_PREFIX=t.MCC_CHIP_ID_PREFIX;exports.MagicLinkDomesticWireDetailsPage=t.MagicLinkDomesticWireDetailsPage;exports.MagicLinkInternationalWireDetailsPage=t.MagicLinkInternationalWireDetailsPage;exports.MagicLinkSuccessPage=t.MagicLinkSuccessPage;exports.MagicLinkVendorACHDetailsPage=t.MagicLinkVendorACHDetailsPage;exports.Modal=t.Modal;exports.MonthEndEmailDrawerCustomerRequestPage=t.MonthEndEmailDrawerCustomerRequestPage;exports.MyBankConnectionsSettingsPage=t.MyBankConnectionsSettingsPage;exports.MyPendingActivationChargeCardListPage=t.MyPendingActivationChargeCardListPage;exports.MyProfileSettingsPage=t.MyProfileSettingsPage;exports.NavBar=t.NavBar;exports.NavBarRightRowStyled=t.NavBarRightRowStyled;exports.NewGlobalMerchantPage=t.NewGlobalMerchantPage;exports.NewUpdateAvailablePage=t.NewUpdateAvailablePage;exports.NotFoundPage=t.NotFoundPage;exports.NotificationIcon=t.SvgNotification;exports.NotificationSettingsPage=t.NotificationSettingsPage;exports.NotificationsPage=t.NotificationsPage;exports.OAuthConsentPage=t.OAuthConsentPage;exports.OnboardingInitialLoader=t.OnboardingInitialLoader;exports.OnboardingSidebar=t.OnboardingSidebar;exports.OnboardingStepFrame=t.OnboardingStepFrame;exports.OpExByVendorPage=t.OpExByVendorPage;exports.OverlayContainerPage=t.OverlayContainerPage;exports.PandLWithForecastPage=t.PandLWithForecastPage;exports.PanelInternalContext=t.PanelInternalContext;exports.PaymentAccountSetupBillingAddressSection=t.PaymentAccountSetupBillingAddressSection;exports.PeoplePage=t.PeoplePage;exports.Picker=t.Picker;exports.PolicyLimitsRowList=t.PolicyLimitsRowList;exports.PolicyModeSelector=t.PolicyModeSelector;exports.PortfolioAllocationFormPage=t.PortfolioAllocationFormPage;exports.QBOConnectionDialog=t.QBOConnectionDialog;exports.QBOSetupSectionWithForm=t.QBOSetupSectionWithForm;exports.QuickResponsesPage=t.QuickResponsesPage;exports.QuickViewModeContext=t.QuickViewModeContext;exports.RIGHT_SIDE_PANEL_WIDTH_PX=t.RIGHT_SIDE_PANEL_WIDTH_PX;exports.ReferralDrawerPage=t.DrawerPage;exports.ReimbursementApprovalRuleDetailPage=t.ReimbursementApprovalRuleDetailPage;exports.ReimbursementApprovalRuleDetailPageV1=t.ReimbursementApprovalRuleDetailPage$1;exports.ReimbursementApprovalRulesPage=t.ReimbursementApprovalRulesPage;exports.ReimbursementApprovalRulesPageV1=t.ReimbursementApprovalRulesPage$1;exports.ReimbursementDetailPage=t.ReimbursementDetailPage;exports.ReimbursementDetailPageSkeleton=t.ReimbursementDetailPageSkeleton;exports.ReimbursementPromoPage=t.ReimbursementPromoPage;exports.ReimbursementSetUpLoading=t.SpendManagementSetUpLoading;exports.ReimbursementSetUpPage=t.RemiSetupPage;exports.RemisBulkReviewDrawerPage=t.ReimbursementsBulkReviewDrawerPage;exports.ReportsPage=t.ReportsPage;exports.ResponsiveSized=t.ResponsiveSized;exports.ReviewBillDetailsPage=t.ReviewBillDetailsPage;exports.ReviewConfirmTransferPanel=t.ReviewConfirmTransferPanel;exports.ReviewDetailsPageSkeleton=t.ReviewDetailsPageSkeleton;exports.ScheduleDetailSkeleton=t.ScheduleDetailSkeleton;exports.ScheduleDetailsAccruedExpensesPage=t.ScheduleDetailsAccruedExpensesPage;exports.ScheduleDetailsFixedAssetsPage=t.ScheduleDetailsFixedAssetsPage;exports.ScheduleDetailsPage=t.ScheduleDetailsPage;exports.SchedulePanelInternalContext=t.SchedulePanelInternalContext;exports.SearchableCheckboxCardList=t.SearchableCheckboxCardList;exports.SessionTimeoutPopup=t.SessionTimeoutPopup;exports.SidePanelContext=t.SidePanelContext;exports.SidePanelProvider=t.SidePanelProvider;exports.SignIn=t.SignIn;exports.SomethingWrongPage=t.SomethingWrongPage;exports.Space=t.Space;exports.SpendManagementListLoading=t.SpendManagementListLoading;exports.SpendManagementListViewPage=t.SpendManagementListViewPage;exports.StatementParseInfo=t.StatementParseInfo;exports.StatementProcessingPage=t.StatementProcessingPage;exports.StatementsPage=t.StatementsPage;exports.StyledCapsule=t.StyledCapsule;exports.SubscriptionDetailPage=t.SubscriptionDetailPage;exports.SubscriptionSummaryPage=t.SubscriptionSummaryPage;exports.SyntheticAiCfoAnswerView=t.SyntheticAiCfoAnswerView;exports.TaskDetailPage=t.TaskDetailPage;exports.TaskManagementPage=t.TaskManagementPage;exports.TenantsDropDown=t.TenantsDropDown;exports.TextStyle=t.TextStyle;exports.ToolkitProvider=t.ToolkitProvider;exports.TopExDetailPage=t.TopExDetailPage;exports.TransactionActivityLogPage=t.TransactionActivityLogPage;exports.TransactionActivityLogPanel=t.TransactionActivityLogPanel;exports.TransactionDetailPage=t.TransactionDetailPage;exports.TransactionDetailSkeleton=t.TransactionDetailSkeleton;exports.TransactionListBig=t.TransactionListBig;exports.TransactionListPage=t.TransactionListPage;exports.TransactionPanelInternalContext=t.TransactionPanelInternalContext;exports.TransactionSidePanelLayout=t.TransactionSidePanelLayout;exports.TransactionVendorDetailPage=t.TransactionVendorDetailPage;exports.TransferDrawerPage=t.TransferDrawerPage;exports.TreasuryOverviewPage=t.TreasuryOverviewPage;exports.TreasuryPromoPage=t.TreasuryPromoPage;exports.TreasurySetUpPage=t.TreasurySetUpPage;exports.TreasuryStatementsPage=t.TreasuryStatementsPage;exports.TreasuryTaxLetterPage=t.TreasuryTaxLetterPage;exports.TreasuryTransferOrReviewPage=t.TreasuryTransferOrReviewPage;exports.TrendChart=t.TrendChart;exports.UncategorizedAccountsMappingPage=t.UncategorizedAccountsMappingPage;exports.UnitIntegrationPage=t.UnitIntegrationPage;exports.VENDOR_CHIP_ID_PREFIX=t.VENDOR_CHIP_ID_PREFIX;exports.Vendor2FAPopup=t.Vendor2FAPopup;exports.VendorACHDetailsPage=t.VendorACHDetailsPage;exports.VendorAccruedSchedulesPage=t.VendorAccruedSchedulesPage;exports.VendorDetailPage=t.VendorDetailPage;exports.VendorDomesticWireDetailsPage=t.VendorDomesticWireDetailsPage;exports.VendorFiling1099DetailsEditablePage=t.VendorFiling1099DetailsEditablePage;exports.VendorFiling1099EditableFormSkeleton=t.VendorFiling1099EditableFormSkeleton;exports.VendorFiling1099ListPage=t.VendorFiling1099ListPage;exports.VendorFirstReviewPage=t.VendorFirstReviewPage;exports.VendorInternationalSwiftBasedDetailsPage=t.VendorInternationalSwiftBasedDetailsPage;exports.VendorInternationalWireDetailsPage=t.VendorInternationalWireDetailsPage;exports.VendorListPage=t.VendorListPage;exports.VendorSchedulesPage=t.VendorSchedulesPage;exports.VerificationFrame=t.VerificationFrame;exports.VerifyDevice=t.VerifyDevice;exports.VerifyUnlockFinancialStackPage=t.VerifyUnlockFinancialStackPage;exports.WebV2MicroService=t.WebV2MicroService;exports.WebV2MicroServiceProvider=t.WebV2MicroServiceProvider;exports.WelcomeAnimation=t.WelcomeAnimation;exports.WindowSizeProvider=t.WindowSizeProvider;exports.ZeniAccountDetailLoading=t.ZeniAccountDetailLoading;exports.ZeniAccountDetailNavBarTitleShimmer=t.ZeniAccountDetailNavBarTitleShimmer;exports.ZeniAccountDetailPage=t.ZeniAccountDetailPage;exports.ZeniAccountListLoading=t.ZeniAccountListLoading;exports.ZeniAccountListViewPage=t.ZeniAccountListViewPage;exports.ZeniAccountPromoPage=t.ZeniAccountPromoPage;exports.ZeniAccountSetUpPage=t.ZeniAccountSetUpPage;exports.ZeniText=t.ZeniText;exports.ZeniThemeProvider=t.ZeniThemeProvider;exports.alignToJustify=t.alignToJustify;exports.amountToString=t.amountToString;exports.amountValueToString=t.amountValueToString;exports.appLocale=t.appLocale;exports.applyExtractedPolicyRulesToFormValues=t.applyExtractedPolicyRulesToFormValues;exports.buildBulkCreateCardPolicyTemplateRequestsFromInteractiveForm=t.buildBulkCreateCardPolicyTemplateRequestsFromInteractiveForm;exports.buildCardPolicyFormValuesFromRequest=t.buildCardPolicyFormValuesFromRequest;exports.buildCreateCardPolicyTemplateRequest=t.buildCreateCardPolicyTemplateRequest;exports.buildCreateCardPolicyTemplateRequestFromInteractiveForm=t.buildCreateCardPolicyTemplateRequestFromInteractiveForm;exports.buildMccCategoryChipId=t.buildMccCategoryChipId;exports.buildStickyKeySet=t.buildStickyKeySet;exports.buildVendorChipId=t.buildVendorChipId;exports.cellVerticalAlignToFlexAlign=t.cellVerticalAlignToFlexAlign;exports.clearAutoLogoutContext=t.clearAutoLogoutContext;exports.clickableRowStyles=t.clickableRowStyles;exports.computeStickyLeftOffsets=t.computeStickyLeftOffsets;exports.darkColors=t.darkColors;exports.darkTheme=t.darkTheme;exports.dashboardCardDimension=t.designDimension;exports.defaultCardPolicyFormValues=t.defaultCardPolicyFormValues;exports.getAlpha2=t.getAlpha2;exports.getAlpha3=t.getAlpha3;exports.getColorForALabel=t.getColorForALabel;exports.getCountries=t.getCountries;exports.getCustomerDataFromAutoComplete=t.getCustomerDataFromAutoComplete;exports.getFullName=t.getFullName;exports.getInitialOpenThreadRequestFromSearch=t.getInitialOpenThreadRequestFromSearch;exports.getRecipientTotalAmount=t.getRecipientTotalAmount;exports.getShowNegativeAmountInParenthesisDefaultValue=t.getShowNegativeAmountInParenthesisDefaultValue;exports.getShowNegativeAmountInParenthesisForPercentDefaultValue=t.getShowNegativeAmountInParenthesisForPercentDefaultValue;exports.getStableTransactionId=t.getStableTransactionId;exports.isCloseManagementMenu=t.isCloseManagementMenu;exports.isClosedCardStatus=t.isClosedCardStatus;exports.isCollaborationEntityType=t.isCollaborationEntityType;exports.isMobileOrTabletView=t.isMobileOrTabletView;exports.isMobilePhoneScreen=t.isMobilePhoneScreen;exports.lightColors=t.lightColors;exports.lightTheme=t.lightTheme;exports.mergeColumnDeclarativeWithRenderers=t.mergeColumnDeclarativeWithRenderers;exports.mergeLayoutDefaults=t.mergeLayoutDefaults;exports.percentValueToString=t.percentValueToString;exports.resolveColumnWidth=t.resolveColumnWidth;exports.roundAmountIfNeeded=t.roundAmountIfNeeded;exports.roundOffNumberToTwoDecimal=t.roundOffNumberToTwoDecimal;exports.setAutoLogoutContext=t.setAutoLogoutContext;exports.setShowNegativeAmountInParenthesisDefaultValue=t.setShowNegativeAmountInParenthesisDefaultValue;exports.setShowNegativeAmountInParenthesisForPercentDefaultValue=t.setShowNegativeAmountInParenthesisForPercentDefaultValue;exports.sp=t.sp;exports.textAlignForCell=t.textAlignForCell;exports.textStyles=t.textStyles;exports.toInstitutionLogoDataUri=t.toInstitutionLogoDataUri;exports.toMccCategoryChipFieldValue=t.toMccCategoryChipFieldValue;exports.toMenuOptionType=t.toMenuOptionType;exports.toSettingsMenuOptionTypeStrict=t.toSettingsMenuOptionTypeStrict;exports.toSupportedLocaleStrict=t.toSupportedLocaleStrict;exports.toVendorChipFieldValue=t.toVendorChipFieldValue;exports.trackTreasuryTransferAnalytics=t.trackTreasuryTransferAnalytics;exports.uploadAttachmentReceipts=t.uploadAttachmentReceipts;exports.useApprovalRulesV3Config=t.useApprovalRulesV3Config;exports.useBackNavigation=t.useBackNavigation;exports.useCollaborationInfoContext=t.useCollaborationInfoContext;exports.useCommentsDrawer=t.useCommentsDrawer;exports.useDropdownPortal=t.useDropdownPortal;exports.useExpenseAutomationEnabledForUser=t.useExpenseAutomationEnabledForUser;exports.useGlobalInfoContext=t.useGlobalInfoContext;exports.useLockBodyScroll=t.useLockBodyScroll;exports.usePanelInternal=t.usePanelInternal;exports.usePrevious=t.usePrevious;exports.useQuickViewMode=t.useQuickViewMode;exports.useRegisterBackHandler=t.useRegisterBackHandler;exports.useRequestCloseAllCommentDrawers=t.useRequestCloseAllCommentDrawers;exports.useSchedulePanelInternal=t.useSchedulePanelInternal;exports.useSessionAutoLogoutConfig=t.useSessionAutoLogoutConfig;exports.useSidePanelContext=t.useSidePanelContext;exports.useToolkitContext=t.useToolkitContext;exports.useTransactionPanelInternal=t.useTransactionPanelInternal;exports.useWindowSizeContext=t.useWindowSizeContext;exports.useZeniCardsVisibilityConfig=t.useZeniCardsVisibilityConfig;exports.useZeniFeatureContext=t.useZeniFeatureContext;exports.useZeniThemeContext=t.useZeniThemeContext;exports.waitFor=t.waitFor;exports.useZeniTheme=o.useTheme;exports.zeniStyled=o.styled;exports.zeniEmotionStyled=s;exports.AiAccountantDetailDrawer=Ey;exports.AiAccountantPage=Xf;exports.AuditReportDrawerPage=z4;exports.COCKPIT_TAB_OPTIONS=rt;exports.COCKPIT_TAB_OPTIONS_WITH_CREDIT_AGENT=qa;exports.CockpitNavBar=wl;exports.CreditAgentPage=K$;exports.HealthMonitorDetailDrawer=ux;exports.HealthMonitorPage=Vh;exports.ManagementPage=wu;exports.MonthEndReportHistoricDataPage=y3;exports.MonthEndReportPage=Qj;exports.NavHeader=dt;exports.OnboardingCustomerPage=XC;exports.OnboardingPage=k2;exports.PortfolioPage=fy;exports.ReviewPage=Rb;exports.SubscriptionAddPlanPage=jS;exports.SubscriptionPage=Qg;exports.SubscriptionUpdatePlanPage=sS;exports.TaskManagerPage=Zu;exports.WarningsDrawerPage=nR;exports.toCockpitOptionType=Rt;exports.toCockpitOptionTypeStrict=vl;
|