import{F as V,aP as W,l as F,o as s,aL as b,bT as B,j as a,aO as N,P as D,aQ as l,aR as J}from"./app-BgLa5dit.js";import{u as Q,U as _,M as O,S as z}from"./B5gexLDR.chunk.js";import{u as K,U as X,S as Z}from"./DGcndnJ4.chunk.js";import{U as $}from"./ZKp_vc-v.chunk.js";import{a as tt}from"./m4aqaK_l.chunk.js";import{C as r,U as et}from"./q-IBKcuF.chunk.js";import{R as at}from"./QfCSKVqV.chunk.js";import{u as rt}from"./BTbeLL99.chunk.js";import{J as st}from"./DfIMhO3y.chunk.js";import{C as ot}from"./CsJ10TwK.chunk.js";import{g as it}from"./B1ElCHu3.chunk.js";import"./1Of0XWgF.chunk.js";import"./qmOk7Utq.chunk.js";import"./BwrBcwEI.chunk.js";import"./BD9MrUJP.chunk.js";import"./EZim8aq-.chunk.js";import"./s6cGcwlA.chunk.js";import"./Zwjmkasg.chunk.js";import"./4qGb1BIY.chunk.js";import"./DnXDEnAR.chunk.js";import"./DpUpv6rY.chunk.js";import"./CG7zbly5.chunk.js";import"./MEkA24R1.chunk.js";import"./C53kfXmd.chunk.js";import"./BT3VnoQK.chunk.js";import"./kiNvuUO3.chunk.js";import"./Bkj-W53y.chunk.js";import"./KIVqng-q.chunk.js";import"./oUIMm7ik.chunk.js";import"./DD0tWTM_.chunk.js";import"./CPXlV0fg.chunk.js";import"./0GREfvNX.chunk.js";import"./Da6gN2lx.chunk.js";import"./DusGkY45.chunk.js";import"./byZ05CcP.chunk.js";import"./DULWIWQR.chunk.js";import"./nb6O6S6P.chunk.js";import"./COKAB0_A.chunk.js";import"./BYVfdcaw.chunk.js";import"./BfMtaC_g.chunk.js";import"./CBiQhiW4.chunk.js";import"./_VQbNI_n.chunk.js";import"./BcnghRSY.chunk.js";import"./DpWmZ9cE.chunk.js";import"./BxYybc33.chunk.js";import"./DkDkjje4.chunk.js";import"./3nM7jLnE.chunk.js";import"./DUpYPoLs.chunk.js";import"./9Z7K2s6J.chunk.js";import"./Cu2-dDll.chunk.js";const m=V.encloseNamespace("userManager.studentManager"),i=B.Learner;function se(t){var S,f,y,I,C,E,x,P;rt({title:m("pageTitle")});const d=W(),u=F(),c=it(t.customerId,i,t.queryParams),p=s(r.customer(t.customerId)),R=s(J.currentUser()),M=s(r.yearGroups(t.customerId)),v=s(st.getYearGroupRolloverStatus(t.customerId)),q=s(r.getCustomerProducts(t.customerId)),A=s(at.ratings()),g=!!((f=(S=p.data)==null?void 0:S._integrations)!=null&&f.rostered),j={imageCdnUrl:ClickView.Config.Urls.ImageAPI},o=Q(t.customerId,t.queryParams,i),h=K(t.customerId),k=h.data&&h.data.count>0,n=o.data?"results"in o.data?o.data.results:o.data.data:null,G=(I=s(r.getAuthenticationMethodsByUserIds(t.customerId,((y=n==null?void 0:n.map(e=>e.id))==null?void 0:y.sort())??[])).data)==null?void 0:I.some(e=>b.hasSso(e)),U=s(r.userCount(t.customerId,i,t.queryParams));function T(e){l(d,r.resendActivationEmail(t.customerId,e.id,()=>{u.success(m("resendActivationEmailSuccess",{email:e.email,escapeText:!0}))},()=>{u.error(m("resendActivationEmailError",{email:e.email,escapeText:!0}))}))}function w(e){l(d,r.resendVerificationEmail(t.customerId,e.id,()=>{u.success(m("verificationEmailSuccess",{email:e.email,escapeText:!0}))},()=>{u.error(m("verificationEmailError",{email:e.email,escapeText:!0}))}))}function L(e){l(d,r.getSearchUserIds(t.customerId,i,t.queryParams,e))}const H=et.showEmptyState(o,t.queryParams);return a.jsxs($.Provider,{value:tt.Curator,children:[k&&a.jsx(X,{ratings:A.data}),H?a.jsx(Z,{appLinks:c}):a.jsxs(a.Fragment,{children:[a.jsx(_,{userType:i,appLinks:c,users:n,userCount:U.data,headingComponent:p.data&&a.jsx(ot,{customer:p.data}),hasRostering:g}),a.jsxs("main",{className:"py-3 clearfix",children:[a.jsx(O,{users:n,userType:i,config:j,currentUser:R.data,searchEmptyState:N.EmptyStates.TYPEAHEAD_RESULTS,appLinks:c,onClickResendActivationEmail:T,onClickSendVerificationEmail:w,totalUsers:(C=U.data)==null?void 0:C.count,queryParams:t.queryParams,yearGroups:M.data,yearGroupRolloverStatus:v.data,fetchUserIds:L,hasSso:G,userRequest:(e,Y)=>r.getUserIdByQuery(t.customerId,e,Y),selectWithSpreadsheetTemplate:z,products:((E=q.data)==null?void 0:E.map(e=>e.id))??[],hasRostering:g}),!!((P=(x=o.data)==null?void 0:x.pagination)!=null&&P.cursors)&&a.jsx(D,{appLink:c.search,cursors:o.data.pagination.cursors,buttonVariant:"outline-dark",className:"py-2 float-end"})]})]})]})}export{se as StudentManagerView};
//# sourceMappingURL=CWm8gDk8.chunk.js.map
