(()=>{var e={};e.id=8489,e.ids=[8489],e.modules={10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},44870:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},77598:e=>{"use strict";e.exports=require("node:crypto")},91657:(e,t,r)=>{"use strict";r.r(t),r.d(t,{patchFetch:()=>m,routeModule:()=>p,serverHooks:()=>d,workAsyncStorage:()=>f,workUnitAsyncStorage:()=>g});var n={};r.r(n),r.d(n,{POST:()=>c});var s=r(42706),o=r(28203),u=r(45994),i=r(39187),a=r(98095),l=r(89249);async function c(){try{if("mysql"!==(0,a.f)())return i.NextResponse.json({error:"Sesion local deshabilitada."},{status:404});let e=i.NextResponse.json({success:!0});return(0,l.C0)(e),e}catch(e){return console.error("[POST /api/auth/logout] error:",e),i.NextResponse.json({error:"Error interno."},{status:500})}}let p=new s.AppRouteRouteModule({definition:{kind:o.RouteKind.APP_ROUTE,page:"/api/auth/logout/route",pathname:"/api/auth/logout",filename:"route",bundlePath:"app/api/auth/logout/route"},resolvedPagePath:"C:\\omrwebapp-git-roregar.cl\\src\\app\\api\\auth\\logout\\route.ts",nextConfigOutput:"standalone",userland:n}),{workAsyncStorage:f,workUnitAsyncStorage:g,serverHooks:d}=p;function m(){return(0,u.patchFetch)({workAsyncStorage:f,workUnitAsyncStorage:g})}},96487:()=>{},78335:()=>{},98095:(e,t,r)=>{"use strict";function n(){return"mysql"===String(process.env.AUTH_MODE||process.env.NEXT_PUBLIC_AUTH_MODE||"").trim().toLowerCase()?"mysql":"firebase"}r.d(t,{f:()=>n})},89249:(e,t,r)=>{"use strict";r.d(t,{$G:()=>d,C0:()=>m,CA:()=>l,Q7:()=>p,zP:()=>g});var n=r(77598),s=r.n(n);let o="omr_local_session";function u(e){return(Buffer.isBuffer(e)?e:Buffer.from(e)).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function i(e){let t=String(e||"").replace(/-/g,"+").replace(/_/g,"/"),r=t.length%4==0?"":"=".repeat(4-t.length%4);return Buffer.from(t+r,"base64")}function a(){return String(process.env.AUTH_SESSION_SECRET||process.env.NEXTAUTH_SECRET||process.env.AUTH_DB_PASSWORD||"").trim()||"omr-local-session-dev-secret-change-me"}function l(){return String(process.env.AUTH_SESSION_COOKIE_NAME||o).trim()||o}function c(){let e=Number(process.env.AUTH_SESSION_TTL_HOURS||168);return Math.round(3600*(Number.isFinite(e)&&e>0?e:168))}function p(e){let t=Math.floor(Date.now()/1e3),r={v:1,iat:t,exp:t+c(),user:e},n=u(JSON.stringify({alg:"HS256",typ:"JWT"})),o=u(JSON.stringify(r)),i=`${n}.${o}`,l=u(s().createHmac("sha256",a()).update(i).digest());return`${i}.${l}`}function f(e){try{return JSON.parse(e)}catch{return null}}function g(e){let t=String(e||"").trim().split(".");if(3!==t.length)return null;let[r,n,o]=t;if(!r||!n||!o)return null;let l=`${r}.${n}`,c=u(s().createHmac("sha256",a()).update(l).digest()),p=Buffer.from(c),g=Buffer.from(o);if(p.length!==g.length||!s().timingSafeEqual(p,g))return null;let d=f(i(r).toString("utf8"));if(!d||"HS256"!==d.alg||"JWT"!==d.typ)return null;let m=f(i(n).toString("utf8"));if(!m||1!==m.v)return null;let S=Math.floor(Date.now()/1e3);if(!Number.isFinite(m.exp)||m.exp<=S)return null;let h=m.user;return h&&String(h.id||"").trim()&&String(h.email||"").trim()?m:null}function d(e,t){e.cookies.set(l(),t,{httpOnly:!0,sameSite:"lax",secure:!0,path:"/",maxAge:c()})}function m(e){e.cookies.set(l(),"",{httpOnly:!0,sameSite:"lax",secure:!0,path:"/",maxAge:0})}}};var t=require("../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),n=t.X(0,[1989,5452],()=>r(91657));module.exports=n})();