import{o as a,aP as I,k as b,j as t,aO as h,bT as j,c2 as B,g as m,aQ as P}from"./app-BgLa5dit.js";import{B as A}from"./C0Fqgg75.chunk.js";import{U as E}from"./D3UuIyr4.chunk.js";import{U as J}from"./ZKp_vc-v.chunk.js";import{a as S}from"./m4aqaK_l.chunk.js";import{u as D}from"./DL8ott7R.chunk.js";import{B as R}from"./DpUpv6rY.chunk.js";import{B as v}from"./DpWmZ9cE.chunk.js";import{C as o,U as w}from"./q-IBKcuF.chunk.js";import{J as G}from"./DfIMhO3y.chunk.js";import{g as H}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"./Bl0-tJo1.chunk.js";import"./DULJTEyC.chunk.js";import"./De9um1Ze.chunk.js";import"./COKAB0_A.chunk.js";import"./BYVfdcaw.chunk.js";import"./BfMtaC_g.chunk.js";import"./R6rHoxuD.chunk.js";import"./0GREfvNX.chunk.js";import"./CG7zbly5.chunk.js";import"./C53kfXmd.chunk.js";import"./DusGkY45.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";function Ce(e){var u;const{users:n,existingUsersHash:p}=D(),i=a(o.yearGroups(e.customerId)),c=a(o.passwordPolicy(e.customerId)),l=a(o.getCustomerProducts(e.customerId)),d=I(),U=b(),s=H(e.customerId,e.userType);function f(r){const k=w.formatCreateOrValidateUserRequest([r],e.userType,e.customerId);return U(o.bulkValidate(k,null))}function g(){if(Object.keys(p).length){y();return}C()}function y(){m.trigger(s.userUploadReviewExistingAccounts)}const x=R.useCreateJobErrorAlert();function C(){const r=v.getJobData({users:n,customerId:e.customerId,userType:e.userType});P(d,G.createUserJob(r,T,x))}function T(r){m.trigger({...s.userUploadStatus.polling,params:{userType:e.userType,jobId:r.id}})}return!e||!i.data?t.jsx(t.Fragment,{}):t.jsx(J.Provider,{value:S.Curator,children:t.jsx(A,{appLinks:s,userType:e.userType,currentStep:"fix-duplicates",canAddExistingUsers:!((u=l.data)!=null&&u.some(r=>r.id===B.Online)),children:t.jsx("div",{className:"px-3",children:t.jsx(E,{onClickConfirm:g,closePopup:e.closePopup,appLinks:s,userType:e.userType,currentUser:{},yearGroups:i.data,validateUser:f,emailRequired:e.userType===j.Staff,passwordPolicy:c.data,emptyStateImageUrl:h.EmptyStates.UserManager.DUPLICATES})})})})}export{Ce as BulkUserUploadFixDuplicatesView};
//# sourceMappingURL=Do-O0Teb.chunk.js.map
