"use strict";(()=>{var e={};e.id=2827,e.ids=[2827],e.modules={20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},92048:e=>{e.exports=require("fs")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},58536:(e,t,a)=>{a.r(t),a.d(t,{originalPathname:()=>x,patchFetch:()=>R,requestAsyncStorage:()=>C,routeModule:()=>_,serverHooks:()=>w,staticGenerationAsyncStorage:()=>k});var r={};a.r(r),a.d(r,{GET:()=>b,dynamic:()=>h});var n=a(49303),s=a(88716),u=a(60670),l=a(87070);let o=/^v?\d+\.\d+\.\d+$/,i=/^[a-zA-Z0-9.\-\s_v]+$/,c=globalThis.__versionCheckCache??(globalThis.__versionCheckCache={result:null,fetchedAt:0,rateLimitResetAt:null});function p(){return"0.4.11"}async function d(){try{var e,t,a;if(null!==c.result&&Date.now()-c.fetchedAt<36e5||c.rateLimitResetAt&&(!(Date.now()>=c.rateLimitResetAt)||(c.rateLimitResetAt=null,0)))return c.result;let r=await fetch("https://api.github.com/repos/Kewton/CommandMate/releases/latest",{headers:{Accept:"application/vnd.github+json","User-Agent":`CommandMate/${p()}`},cache:"no-store",signal:AbortSignal.timeout(5e3)});if(403===r.status)return function(e){let t=e.headers.get("X-RateLimit-Reset");t?c.rateLimitResetAt=1e3*parseInt(t,10):c.rateLimitResetAt=Date.now()+36e5}(r),c.result;if(!r.ok)return c.result;let n=await r.json(),s=p(),u=n.tag_name.replace(/^v/,""),l={hasUpdate:function(e,t){if(!o.test(e)||!o.test(t))return!1;let a=e=>e.replace(/^v/,"").split(".").map(Number),[r,n,s]=a(e),[u,l,i]=a(t);return u!==r?u>r:l!==n?l>n:i>s}(s,n.tag_name),currentVersion:s,latestVersion:u,releaseUrl:(e=n.html_url).startsWith("https://github.com/Kewton/CommandMate/releases/")?e:null,releaseName:(t=n.name,a=n.tag_name,i.test(t)&&t.length<=128?t:a),publishedAt:n.published_at};return c.result=l,c.fetchedAt=Date.now(),l}catch{return c.result}}var m=a(16672);let h="force-dynamic";function g(){try{return(0,m.ZP)()?"global":"local"}catch{return"unknown"}}let f={"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache"};function A(e){return l.NextResponse.json(e,{headers:f})}function v(e,t){return e?{status:"success",hasUpdate:e.hasUpdate,currentVersion:e.currentVersion,latestVersion:e.latestVersion,releaseUrl:e.releaseUrl,releaseName:e.releaseName,publishedAt:e.publishedAt,installType:t,updateCommand:e.hasUpdate&&"global"===t?"npm install -g commandmate@latest":null}:{status:"degraded",hasUpdate:!1,currentVersion:p(),latestVersion:null,releaseUrl:null,releaseName:null,publishedAt:null,installType:t,updateCommand:null}}async function b(){try{let e=await d(),t=g();return A(v(e,t))}catch{return A(v(null,g()))}}let _=new n.AppRouteRouteModule({definition:{kind:s.x.APP_ROUTE,page:"/api/app/update-check/route",pathname:"/api/app/update-check",filename:"route",bundlePath:"app/api/app/update-check/route"},resolvedPagePath:"/home/runner/work/CommandMate/CommandMate/src/app/api/app/update-check/route.ts",nextConfigOutput:"",userland:r}),{requestAsyncStorage:C,staticGenerationAsyncStorage:k,serverHooks:w}=_,x="/api/app/update-check/route";function R(){return(0,u.patchFetch)({serverHooks:w,staticGenerationAsyncStorage:k})}},16672:(e,t,a)=>{a.d(t,{ZP:()=>n}),a(92048);var r=a(55315);function n(){let e=(0,r.dirname)(__dirname);return e.includes("/lib/node_modules/")||e.includes("\\node_modules\\")||e.includes("/node_modules/commandmate")}a(19801)}};var t=require("../../../../webpack-runtime.js");t.C(e);var a=e=>t(t.s=e),r=t.X(0,[8948,5972],()=>a(58536));module.exports=r})();