"use strict";(()=>{var e={};e.id=9032,e.ids=[9032],e.modules={2934:e=>{e.exports=require("next/dist/client/components/action-async-storage.external.js")},4580:e=>{e.exports=require("next/dist/client/components/request-async-storage.external.js")},5869:e=>{e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},7147:e=>{e.exports=require("fs")},1017:e=>{e.exports=require("path")},2925:(e,r,t)=>{t.r(r),t.d(r,{headerHooks:()=>h,originalPathname:()=>f,patchFetch:()=>g,requestAsyncStorage:()=>l,routeModule:()=>d,serverHooks:()=>m,staticGenerationAsyncStorage:()=>p,staticGenerationBailout:()=>v});var n={};t.r(n),t.d(n,{GET:()=>u});var o=t(5419),i=t(9108),s=t(9678),a=t(2509),c=t(8070);async function u(){try{let e=await (0,a.e)(),{data:{user:r},error:t}=await e.auth.getUser();if(t||!r)return c.Z.json({isSuperAdmin:!1,error:"Unauthorized"},{status:401});let n=(0,a.createAdminClient)(),{data:o,error:i}=await n.from("platform_users").select("role").eq("user_id",r.id).eq("role","super_admin").single();if(i)return console.error("Error checking platform_users:",i),"PGRST116"!==i.code&&console.error("Unexpected error:",i),c.Z.json({isSuperAdmin:!1,error:i.message});if(!o)return c.Z.json({isSuperAdmin:!1});return c.Z.json({isSuperAdmin:!0,role:o.role})}catch(e){return console.error("Error checking super admin:",e),c.Z.json({isSuperAdmin:!1,error:"Internal server error"},{status:500})}}let d=new o.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/admin/license-check/route",pathname:"/api/admin/license-check",filename:"route",bundlePath:"app/api/admin/license-check/route"},resolvedPagePath:"C:\\xampp\\htdocs\\AI Woo Chat\\src\\app\\api\\admin\\license-check\\route.ts",nextConfigOutput:"standalone",userland:n}),{requestAsyncStorage:l,staticGenerationAsyncStorage:p,serverHooks:m,headerHooks:h,staticGenerationBailout:v}=d,f="/api/admin/license-check/route";function g(){return(0,s.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:p})}},2509:(e,r,t)=>{t.d(r,{createAdminClient:()=>a,e:()=>s});var n=t(6874),o=t(7439),i=t(3950);async function s(){let e=await (0,o.cookies)();return(0,n.lx)("https://drmuwsxyvvfivdfsyydy.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImRybXV3c3h5dnZmaXZkZnN5eWR5Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0NjAwMDgsImV4cCI6MjA4NDAzNjAwOH0.kMsFG-VLNqwzIgl3cFW-owiRCWHcB47M6V6Ti4O4alY",{cookies:{get:r=>e.get(r)?.value,set(r,t,n){try{e.set({name:r,value:t,...n})}catch(e){}},remove(r,t){try{e.set({name:r,value:"",...t})}catch(e){}}}})}function a(){return(0,i.eI)("https://drmuwsxyvvfivdfsyydy.supabase.co",process.env.SUPABASE_SERVICE_ROLE_KEY,{auth:{autoRefreshToken:!1,persistSession:!1}})}(0,t(4113).C)()},4113:(e,r,t)=>{t.d(r,{C:()=>s});var n=t(7147),o=t(1017);let i=!1;function s(){if(!i)try{let e=process.cwd(),r=[(0,o.join)(e,".env.production"),(0,o.join)(e,"..",".env.production"),(0,o.join)(e,"..","..",".env.production"),(0,o.join)(e,"app",".env.production")],t=null,s=null;for(let e of r)try{s=(0,n.readFileSync)(e,"utf-8"),t=e,console.log("[EnvLoader] Found .env.production at:",e);break}catch{continue}if(!s||!t)throw Error(`Could not find .env.production. Tried: ${r.join(", ")}`);for(let e of s.split("\n")){let r=e.trim();if(!r||r.startsWith("#"))continue;let t=r.match(/^([^=]+)=(.*)$/);if(t){let e=t[1].trim(),r=t[2].trim();(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))&&(r=r.slice(1,-1)),process.env[e]||(process.env[e]=r)}}i=!0,console.log("[EnvLoader] Loaded environment variables from .env.production"),console.log("[EnvLoader] SUPABASE_DB_URL:",process.env.SUPABASE_DB_URL?"SET":"NOT SET")}catch(e){"ENOENT"===e.code?console.warn("[EnvLoader] .env.production file not found at:",envPath):console.warn("[EnvLoader] Could not load .env.production:",e.message)}}}};var r=require("../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),n=r.X(0,[1638,9989,6206],()=>t(2925));module.exports=n})();