module.exports=[193695,(a,b,c)=>{b.exports=a.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},650645,a=>{a.n(a.i(827572))},923576,a=>{a.n(a.i(104858))},517537,a=>{a.n(a.i(903363))},13718,a=>{a.n(a.i(685523))},118198,a=>{a.n(a.i(545518))},262212,a=>{a.n(a.i(866114))},318173,a=>{a.n(a.i(454309))},140625,a=>{a.n(a.i(119285))},479e3,a=>{a.n(a.i(581901))},424873,a=>a.a(async(b,c)=>{try{var d=a.i(766518),e=b([d]);async function f(){return d.prisma.product.findMany({include:{category:!0,sizes:{orderBy:{sortOrder:"asc"}}},orderBy:{sortOrder:"asc"}})}async function g(a){return d.prisma.product.findUnique({where:{id:a},include:{category:!0,sizes:{orderBy:{sortOrder:"asc"}},activeIngredients:{orderBy:{sortOrder:"asc"}},warnings:{orderBy:{sortOrder:"asc"}},dosageTableRows:{orderBy:{sortOrder:"asc"}},galleryImages:{orderBy:{sortOrder:"asc"}}}})}async function h(){return d.prisma.productCategory.findMany({orderBy:{sortOrder:"asc"},include:{_count:{select:{products:!0}}}})}async function i(){return d.prisma.product.findMany({where:{isPublished:!0},include:{category:!0,sizes:{orderBy:{sortOrder:"asc"}},activeIngredients:{orderBy:{sortOrder:"asc"}},warnings:{orderBy:{sortOrder:"asc"}},dosageTableRows:{orderBy:{sortOrder:"asc"}}},orderBy:{sortOrder:"asc"}})}async function j(a){return d.prisma.product.findFirst({where:{slug:a,isPublished:!0},include:{category:!0,sizes:{orderBy:{sortOrder:"asc"}},activeIngredients:{orderBy:{sortOrder:"asc"}},warnings:{orderBy:{sortOrder:"asc"}},dosageTableRows:{orderBy:{sortOrder:"asc"}}}})}[d]=e.then?(await e)():e,a.s(["getProductById",()=>g,"getProductCategories",()=>h,"getProducts",()=>f,"getPublishedProductBySlug",()=>j,"getPublishedProducts",()=>i]),c()}catch(a){c(a)}},!1),66073,a=>{"use strict";a.s(["ProductForm",()=>b]);let b=(0,a.i(211857).registerClientReference)(function(){throw Error("Attempted to call ProductForm() from the server but ProductForm is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/src/app/(admin)/admin/products/_components/ProductForm.tsx <module evaluation>","ProductForm")},937052,a=>{"use strict";a.s(["ProductForm",()=>b]);let b=(0,a.i(211857).registerClientReference)(function(){throw Error("Attempted to call ProductForm() from the server but ProductForm is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/src/app/(admin)/admin/products/_components/ProductForm.tsx","ProductForm")},65307,a=>{"use strict";a.i(66073);var b=a.i(937052);a.n(b)},200158,a=>a.a(async(b,c)=>{try{var d=a.i(907997);a.i(570396);var e=a.i(673727),f=a.i(109307),g=a.i(451569),h=a.i(424873),i=a.i(65307),j=b([f,h]);async function k(){let a=await (0,f.auth)();a?.user||(0,e.redirect)("/admin/login");let b=a.user.role;(0,g.hasPermission)(b,"products.create")||(0,e.redirect)("/admin/products");let c=await (0,h.getProductCategories)();return(0,d.jsx)(i.ProductForm,{categories:c})}[f,h]=j.then?(await j)():j,a.s(["default",()=>k]),c()}catch(a){c(a)}},!1)];

//# sourceMappingURL=%5Broot-of-the-server%5D__4ce35892._.js.map