module.exports=[451569,a=>{"use strict";let b={"products.view":["SUPER_ADMIN","MODERATOR"],"products.create":["SUPER_ADMIN"],"products.edit":["SUPER_ADMIN","MODERATOR"],"products.delete":["SUPER_ADMIN"],"blog.view":["SUPER_ADMIN","BLOG_EDITOR","MODERATOR"],"blog.create":["SUPER_ADMIN","BLOG_EDITOR"],"blog.edit":["SUPER_ADMIN","BLOG_EDITOR","MODERATOR"],"blog.publish":["SUPER_ADMIN","BLOG_EDITOR"],"blog.delete":["SUPER_ADMIN"],"team.view":["SUPER_ADMIN"],"team.manage":["SUPER_ADMIN"],"jobs.view":["SUPER_ADMIN","HR_MANAGER"],"jobs.manage":["SUPER_ADMIN","HR_MANAGER"],"inquiries.view":["SUPER_ADMIN","SUPPORT_AGENT","MODERATOR"],"inquiries.manage":["SUPER_ADMIN","SUPPORT_AGENT"],"tickets.view":["SUPER_ADMIN","SUPPORT_AGENT"],"tickets.manage":["SUPER_ADMIN","SUPPORT_AGENT"],"tickets.assign":["SUPER_ADMIN"],"leads.view":["SUPER_ADMIN","SUPPORT_AGENT"],"leads.manage":["SUPER_ADMIN","SUPPORT_AGENT"],"users.view":["SUPER_ADMIN"],"users.manage":["SUPER_ADMIN"],"services.view":["SUPER_ADMIN","MODERATOR"],"services.create":["SUPER_ADMIN"],"services.edit":["SUPER_ADMIN","MODERATOR"],"services.delete":["SUPER_ADMIN"],"pages.view":["SUPER_ADMIN","MODERATOR"],"pages.create":["SUPER_ADMIN"],"pages.edit":["SUPER_ADMIN","MODERATOR"],"pages.delete":["SUPER_ADMIN"],"publications.view":["SUPER_ADMIN","BLOG_EDITOR","MODERATOR"],"publications.create":["SUPER_ADMIN","BLOG_EDITOR"],"publications.edit":["SUPER_ADMIN","BLOG_EDITOR","MODERATOR"],"publications.delete":["SUPER_ADMIN"],"outlets.view":["SUPER_ADMIN","MODERATOR"],"outlets.create":["SUPER_ADMIN"],"outlets.edit":["SUPER_ADMIN","MODERATOR"],"outlets.delete":["SUPER_ADMIN"],"settings.view":["SUPER_ADMIN"],"settings.edit":["SUPER_ADMIN"],"sops.view":["SUPER_ADMIN","BLOG_EDITOR","HR_MANAGER","MODERATOR","SUPPORT_AGENT"],"sops.create":["SUPER_ADMIN","MODERATOR"],"sops.edit":["SUPER_ADMIN","MODERATOR"],"sops.approve":["SUPER_ADMIN"],"sops.delete":["SUPER_ADMIN"],"sop-categories.view":["SUPER_ADMIN","MODERATOR"],"sop-categories.manage":["SUPER_ADMIN"],"media.view":["SUPER_ADMIN","MODERATOR"],"media.upload":["SUPER_ADMIN","MODERATOR"],"media.delete":["SUPER_ADMIN"]};function c(a,c){return b[c].includes(a)}a.s(["hasPermission",()=>c])},905895,a=>{"use strict";var b=a.i(53112);let c=b.z.object({firstName:b.z.string().min(1,"First name is required"),lastName:b.z.string().min(1,"Last name is required"),email:b.z.string().email("Invalid email"),phone:b.z.string().optional().nullable(),company:b.z.string().optional().nullable(),interest:b.z.string().optional().nullable(),status:b.z.enum(["NEW","CONTACTED","QUALIFIED","CONVERTED","LOST"]),notes:b.z.string().optional().nullable()});a.s(["leadSchema",0,c])},690264,a=>a.a(async(b,c)=>{try{var d=a.i(137936),e=a.i(118558),f=a.i(766518),g=a.i(705949),h=a.i(905895),i=a.i(713095),j=b([f,g]);async function k(a){await (0,g.requirePermission)("leads.manage");let b=h.leadSchema.safeParse(a);return b.success?(await f.prisma.lead.create({data:{...b.data,phone:b.data.phone??null,company:b.data.company??null,interest:b.data.interest??null,notes:b.data.notes??null}}),(0,e.revalidatePath)("/admin/support/leads"),{success:!0}):{error:b.error.issues[0].message}}async function l(a,b){await (0,g.requirePermission)("leads.manage");let c=h.leadSchema.safeParse(b);return c.success?(await f.prisma.lead.update({where:{id:a},data:{...c.data,phone:c.data.phone??null,company:c.data.company??null,interest:c.data.interest??null,notes:c.data.notes??null}}),(0,e.revalidatePath)("/admin/support/leads"),{success:!0}):{error:c.error.issues[0].message}}async function m(a){await (0,g.requirePermission)("leads.manage"),await f.prisma.lead.delete({where:{id:a}}),(0,e.revalidatePath)("/admin/support/leads")}async function n(a,b){await (0,g.requirePermission)("leads.manage"),await f.prisma.lead.update({where:{id:a},data:{status:b}}),(0,e.revalidatePath)("/admin/support/leads")}[f,g]=j.then?(await j)():j,(0,i.ensureServerEntryExports)([k,l,m,n]),(0,d.registerServerReference)(k,"4025043dc0ee3404ffe2a83df0c23e4622c6ac850e",null),(0,d.registerServerReference)(l,"60878cb1d793a25bcbf69a6fa0dbf8ee776017ad55",null),(0,d.registerServerReference)(m,"40d7deeab3d5483eae37e0cf9f010c1cb0f1d56986",null),(0,d.registerServerReference)(n,"6014aeea860b3b63c11e07296017e5e6e76242c90d",null),a.s(["createLead",()=>k,"deleteLead",()=>m,"updateLead",()=>l,"updateLeadStatus",()=>n]),c()}catch(a){c(a)}},!1),417097,a=>a.a(async(b,c)=>{try{var d=a.i(690264),e=b([d]);[d]=e.then?(await e)():e,a.s([]),c()}catch(a){c(a)}},!1),492381,a=>a.a(async(b,c)=>{try{var d=a.i(417097),e=a.i(690264),f=b([d,e]);[d,e]=f.then?(await f)():f,a.s(["60878cb1d793a25bcbf69a6fa0dbf8ee776017ad55",()=>e.updateLead]),c()}catch(a){c(a)}},!1)];

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