module.exports=[900,a=>{"use strict";var b=a.i(72336);a.s([],2421),a.i(2421),a.s(["40875bde5246cbfa3f917c3c0e14726c239642759d",()=>b.updateUserRole,"409f956cae1cf472851e2f206abb7be7100da4067a",()=>b.createUser,"40c474f0a10cad42cf1f19fee50c343c6264538425",()=>b.toggleUserActive,"40dc3b8c288c24725c0fdced57905741ddffbab881",()=>b.resetUserPassword],900)},72336,a=>{"use strict";var b=a.i(37936),c=a.i(18558),d=a.i(72849),e=a.i(66518),f=a.i(9307),g=a.i(36580);function h(a){if(null==a)return null;let b=String(a).trim();return""===b?null:b}async function i(a){let b=await (0,f.requireAccess)("systeme","write"),i=String(a.get("email")??"").trim().toLowerCase(),j=String(a.get("password")??""),k=String(a.get("firstName")??"").trim(),l=String(a.get("lastName")??"").trim();if(!i||!j||!k||!l||await e.prisma.user.findUnique({where:{email:i}}))return;let m=await d.default.hash(j,10);await e.prisma.user.create({data:{email:i,passwordHash:m,firstName:k,lastName:l,role:a.get("role")??"TALENT_MANAGER",department:a.get("department")??null,position:h(a.get("position")),phone:h(a.get("phone"))}}),await (0,g.logActivity)({userId:b.id,action:"CREATION",entity:"Utilisateur",details:i}),(0,c.revalidatePath)("/collaborators"),(0,c.revalidatePath)("/settings/users")}async function j(a){let b=await (0,f.requireAccess)("systeme","write"),d=String(a.get("id")),h=await e.prisma.user.findUnique({where:{id:d}});h&&(await e.prisma.user.update({where:{id:d},data:{active:!h.active}}),await (0,g.logActivity)({userId:b.id,action:"MODIFICATION",entity:"Utilisateur",entityId:d,details:`Actif → ${!h.active}`}),(0,c.revalidatePath)("/collaborators"),(0,c.revalidatePath)("/settings/users"))}async function k(a){let b=await (0,f.requireAccess)("systeme","write"),d=String(a.get("id"));await e.prisma.user.update({where:{id:d},data:{role:a.get("role")??"TALENT_MANAGER",department:a.get("department")??null,position:h(a.get("position"))}}),await (0,g.logActivity)({userId:b.id,action:"MODIFICATION",entity:"Utilisateur",entityId:d}),(0,c.revalidatePath)("/collaborators"),(0,c.revalidatePath)("/settings/users")}async function l(a){let b=await (0,f.requireAccess)("systeme","write"),h=String(a.get("id")),i=String(a.get("password")??"");if(i.length<6)return;let j=await d.default.hash(i,10);await e.prisma.user.update({where:{id:h},data:{passwordHash:j}}),await (0,g.logActivity)({userId:b.id,action:"MODIFICATION",entity:"Utilisateur",entityId:h,details:"Réinitialisation du mot de passe"}),(0,c.revalidatePath)("/settings/users")}(0,a.i(13095).ensureServerEntryExports)([i,j,k,l]),(0,b.registerServerReference)(i,"409f956cae1cf472851e2f206abb7be7100da4067a",null),(0,b.registerServerReference)(j,"40c474f0a10cad42cf1f19fee50c343c6264538425",null),(0,b.registerServerReference)(k,"40875bde5246cbfa3f917c3c0e14726c239642759d",null),(0,b.registerServerReference)(l,"40dc3b8c288c24725c0fdced57905741ddffbab881",null),a.s(["createUser",0,i,"resetUserPassword",0,l,"toggleUserActive",0,j,"updateUserRole",0,k])},36580,a=>{"use strict";var b=a.i(66518);async function c(a){return b.prisma.activityLog.create({data:{userId:a.userId,action:a.action,entity:a.entity,entityId:a.entityId??null,details:a.details??null}})}a.s(["logActivity",0,c])}];

//# sourceMappingURL=_0gkxwld._.js.map