"use strict";(()=>{var t={};t.id=7286,t.ids=[7286],t.modules={20399:t=>{t.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:t=>{t.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},84770:t=>{t.exports=require("crypto")},51614:(t,e,r)=>{r.r(e),r.d(e,{originalPathname:()=>f,patchFetch:()=>v,requestAsyncStorage:()=>p,routeModule:()=>d,serverHooks:()=>h,staticGenerationAsyncStorage:()=>m});var n={};r.r(n),r.d(n,{GET:()=>c,dynamic:()=>s});var o=r(49303),a=r(88716),u=r(60670),l=r(87070),i=r(23402);let s="force-dynamic";async function c(){return l.NextResponse.json({authEnabled:(0,i.KL)()})}let d=new o.AppRouteRouteModule({definition:{kind:a.x.APP_ROUTE,page:"/api/auth/status/route",pathname:"/api/auth/status",filename:"route",bundlePath:"app/api/auth/status/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/auth/status/route.ts",nextConfigOutput:"",userland:n}),{requestAsyncStorage:p,staticGenerationAsyncStorage:m,serverHooks:h}=d,f="/api/auth/status/route";function v(){return(0,u.patchFetch)({serverHooks:h,staticGenerationAsyncStorage:m})}},23402:(t,e,r)=>{r.d(e,{HI:()=>a,pC:()=>i,Gn:()=>h,H2:()=>f,n8:()=>m,KL:()=>p,WX:()=>d});var n=r(84770),o=r.n(n);let a="cm_auth_token",u=/^[0-9a-f]{64}$/,l={maxAttempts:5,lockoutDuration:9e5,cleanupInterval:36e5},i=86400,s=(()=>{let t=process.env.CM_AUTH_TOKEN_HASH||void 0;if(t){if(!function(t){return!!t&&u.test(t)}(t)){console.error("[auth] CM_AUTH_TOKEN_HASH is not a valid SHA-256 hash");return}return t}})(),c=function(){let t=process.env.CM_AUTH_EXPIRE,e=Date.now();if(t)try{return e+function(t){let e=t.match(/^(\d+)([hdm])$/);if(!e)throw Error(`Invalid duration format: "${t}". Use Nh, Nd, or Nm (e.g., "24h", "7d", "90m")`);let r=parseInt(e[1],10),n=e[2],o={h:36e5,d:864e5,m:6e4}[n];if(void 0===o)throw Error(`Invalid duration unit: "${n}"`);let a=r*o;if(a<36e5)throw Error(`Duration too short: minimum is 1h (60m). Got: "${t}"`);if(a>2592e6)throw Error(`Duration too long: maximum is 30d (720h). Got: "${t}"`);return a}(t)}catch{return e+864e5}return process.env.CM_AUTH_TOKEN_HASH?e+864e5:null}();function d(t){if(!s||!t||"string"!=typeof t||null!==c&&Date.now()>c)return!1;let e=o().createHash("sha256").update(t).digest("hex"),r=Buffer.from(e,"hex"),n=Buffer.from(s,"hex");return r.length===n.length&&o().timingSafeEqual(r,n)}function p(){return!!s}function m(){if(null===c)return 0;let t=c-Date.now();return t<=0?0:Math.floor(t/1e3)}function h(t){return{httpOnly:!0,sameSite:"strict",secure:!!process.env.CM_HTTPS_CERT,maxAge:t,path:"/"}}function f(){let t=new Map,e=setInterval(()=>{let e=Date.now();for(let[r,n]of t){let o=null===n.lockedUntil||e>n.lockedUntil,a=e-n.lastAttempt>l.lockoutDuration;o&&a&&t.delete(r)}},l.cleanupInterval);return e.unref&&e.unref(),{checkLimit(e){let r=t.get(e);if(!r)return{allowed:!0};if(null!==r.lockedUntil){let t=Date.now();if(t<r.lockedUntil)return{allowed:!1,retryAfter:Math.ceil((r.lockedUntil-t)/1e3)};r.attempts=0,r.lockedUntil=null}return{allowed:!0}},recordFailure(e){let r=Date.now(),n=t.get(e)||{attempts:0,lockedUntil:null,lastAttempt:r};n.attempts++,n.lastAttempt=r,n.attempts>=l.maxAttempts&&(n.lockedUntil=r+l.lockoutDuration),t.set(e,n)},recordSuccess(e){t.delete(e)},destroy(){clearInterval(e),t.clear()}}}}};var e=require("../../../../webpack-runtime.js");e.C(t);var r=t=>e(e.s=t),n=e.X(0,[8948,5972],()=>r(51614));module.exports=n})();