import{o as m,aP as A,j as l,eL as j,bs as B,bq as R,br as h,aO as d,ag as E,c2 as J,F as x,bT as D,aQ as O,g as P}from"./app-BgLa5dit.js";import{B as W,a as _}from"./C0Fqgg75.chunk.js";import{u as M}from"./DL8ott7R.chunk.js";import{B as g}from"./DpUpv6rY.chunk.js";import{B as U}from"./DpWmZ9cE.chunk.js";import{a as z}from"./CTNq1KmP.chunk.js";import{u as H}from"./PpGk0l1b.chunk.js";import{J as o}from"./DfIMhO3y.chunk.js";import{C as V}from"./q-IBKcuF.chunk.js";import{g as q}from"./B1ElCHu3.chunk.js";import"./BTbZzD17.chunk.js";import"./MEkA24R1.chunk.js";import"./B3eOBVf8.chunk.js";import"./3nM7jLnE.chunk.js";import"./CPXlV0fg.chunk.js";import"./DJ0pq8J_.chunk.js";import"./CG7zbly5.chunk.js";import"./m4aqaK_l.chunk.js";import"./C53kfXmd.chunk.js";import"./DusGkY45.chunk.js";import"./BxYybc33.chunk.js";import"./DkDkjje4.chunk.js";import"./8Im-OACs.chunk.js";import"./g56uS58q.chunk.js";import"./vyqb6V0P.chunk.js";import"./DUpYPoLs.chunk.js";import"./EZim8aq-.chunk.js";import"./BD9MrUJP.chunk.js";import"./s6cGcwlA.chunk.js";import"./Zwjmkasg.chunk.js";import"./4qGb1BIY.chunk.js";import"./DnXDEnAR.chunk.js";const v="userManager.bulkUserUploadStatusCompleted",C=x.encloseNamespace(v);function ke(e){var p;const{users:a,existingUserToAdd:r,existingUsersHash:b}=M(),i=q(e.customerId,e.userType),n=m(o.getJob(e.jobId)),u=m(o.getJobSummary(e.jobId)),y=m(V.getCustomerProducts(e.customerId));H(n);const f=A(),I=g.useCreateJobErrorAlert(),s=U.getNewUsers(a,b);function L(){const t=U.getJobData({users:s,existingUsers:r,customerId:e.customerId,userType:e.userType});O(f,o.createUserJob(t,k,I))}function k(t){P.trigger({...i.userUploadStatus.polling,params:{userType:e.userType,jobId:t.id}})}const c=((s==null?void 0:s.length)??0)+((r==null?void 0:r.length)??0);function S(){return e.userType===D.Learner?C("createStudentsSuccess",{smartCount:c}):C("createStaffSuccess",{smartCount:c})}const T=!!n.data&&!!u.data;return l.jsx(W,{appLinks:i,userType:e.userType,currentStep:"status",canAddExistingUsers:!((p=y.data)!=null&&p.some(t=>t.id===J.Online)),children:!!T&&l.jsx(z,{job:n.data,objectCount:a.length,objectType:E.User,summary:u.data,userType:e.userType,finishAppLink:i.userManager,imageCdnUrl:ClickView.Config.Urls.ImageAPI,successImageUrl:d.Wizard.WIZARD_SUCCESS,failedImageUrl:d.Wizard.WIZARD_ERROR,onClickTryAgain:L,getResultsRequest:o.getJobResults,actionSucceededMessage:S(),navLockId:_,actionVerb:"Create",analyticsOptions:{location:h.BulkUserUploadWizard,entity:R.User,actionType:B.Create,descriptor:j.Bulk},preventLoggingAnalytics:!a,getErrorListItem:t=>g.getErrorListItem(t,ClickView.Config.Urls.ImageAPI)})})}export{ke as BulkUserUploadStatusCompleteView};
//# sourceMappingURL=DvmmP0k4.chunk.js.map
