You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
157 KiB
JavaScript

9 months ago
(()=>{var e={"../next-env/dist/index.js":(e,t,r)=>{(()=>{var t={383:e=>{"use strict";e.exports.j=function(e){let t=e.ignoreProcessEnv?{}:process.env;for(let r in e.parsed){let i=Object.prototype.hasOwnProperty.call(t,r)?t[r]:e.parsed[r];e.parsed[r]=(function e(t,r,i){let s=function(e,t){let r=Array.from(e.matchAll(t));return r.length>0?r.slice(-1)[0].index:-1}(t,/(?!(?<=\\))\$/g);if(-1===s)return t;let n=t.slice(s),a=n.match(/((?!(?<=\\))\${?([\w]+)(?::-([^}\\]*))?}?)/);if(null!=a){let[,s,n,o]=a;return e(t.replace(s,r[n]||o||i.parsed[n]||""),r,i)}return t})(i,t,e).replace(/\\\$/g,"$")}for(let r in e.parsed)t[r]=e.parsed[r];return e}},234:(e,t,r)=>{let i=r(147),s=r(17),n=r(37),a=r(113),o=r(803),l=o.version,h=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;function d(e){console.log(`[dotenv@${l}][DEBUG] ${e}`)}function u(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function c(e){let t=s.resolve(process.cwd(),".env");return e&&e.path&&e.path.length>0&&(t=e.path),t.endsWith(".vault")?t:`${t}.vault`}let p={configDotenv:function(e){let t=s.resolve(process.cwd(),".env"),r="utf8",a=!!(e&&e.debug);if(e){if(null!=e.path){var o;t="~"===(o=e.path)[0]?s.join(n.homedir(),o.slice(1)):o}null!=e.encoding&&(r=e.encoding)}try{let s=p.parse(i.readFileSync(t,{encoding:r})),n=process.env;return e&&null!=e.processEnv&&(n=e.processEnv),p.populate(n,s,e),{parsed:s}}catch(e){return a&&d(`Failed to load ${t} ${e.message}`),{error:e}}},_configVault:function(e){console.log(`[dotenv@${l}][INFO] Loading env from encrypted .env.vault`);let t=p._parseVault(e),r=process.env;return e&&null!=e.processEnv&&(r=e.processEnv),p.populate(r,t,e),{parsed:t}},_parseVault:function(e){let t;let r=c(e),i=p.configDotenv({path:r});if(!i.parsed)throw Error(`MISSING_DATA: Cannot parse ${r} for an unknown reason`);let s=u(e).split(","),n=s.length;for(let e=0;e<n;e++)try{let r=s[e].trim(),n=function(e,t){let r;try{r=new URL(t)}catch(e){if("ERR_INVALID_URL"===e.code)throw Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development");throw e}let i=r.password;if(!i)throw Error("INVALID_DOTENV_KEY: Missing key part");let s=r.searchParams.get("environment");if(!s)throw Error("INVALID_DOTENV_KEY: Missing environment part");let n=`DOTENV_VAULT_${s.toUpperCase()}`,a=e.parsed[n];if(!a)throw Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${n} in your .env.vault file.`);return{ciphertext:a,key:i}}(i,r);t=p.decrypt(n.ciphertext,n.key);break}catch(t){if(e+1>=n)throw t}return p.parse(t)},config:function(e){let t=c(e);return 0===u(e).length?p.configDotenv(e):i.existsSync(t)?p._configVault(e):(console.log(`[dotenv@${l}][WARN] You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),p.configDotenv(e))},decrypt:function(e,t){let r=Buffer.from(t.slice(-64),"hex"),i=Buffer.from(e,"base64"),s=i.slice(0,12),n=i.slice(-16);i=i.slice(12,-16);try{let e=a.createDecipheriv("aes-256-gcm",r,s);return e.setAuthTag(n),`${e.update(i)}${e.final()}`}catch(i){let e=i instanceof RangeError,t="Invalid key length"===i.message,r="Unsupported state or unable to authenticate data"===i.message;if(e||t)throw Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");if(r)throw Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw console.error("Error: ",i.code),console.error("Error: ",i.message),i}},parse:function(e){let t;let r={},i=e.toString();for(i=i.replace(/\r\n?/gm,"\n");null!=(t=h.exec(i));){let e=t[1],i=t[2]||"";i=i.trim();let s=i[0];i=i.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),'"'===s&&(i=(i=i.replace(/\\n/g,"\n")).replace(/\\r/g,"\r")),r[e]=i}return r},populate:function(e,t,r={}){let i=!!(r&&r.debug),s=!!(r&&r.override);if("object"!=typeof t)throw Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");for(let r of Object.keys(
* cookie
* Copyright(c) 2012-2014 Roman Shtylman
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/t.parse=function(t,r){if("string"!=typeof t)throw TypeError("argument str must be a string");for(var s={},n=t.split(i),a=(r||{}).decode||e,o=0;o<n.length;o++){var l=n[o],h=l.indexOf("=");if(!(h<0)){var d=l.substr(0,h).trim(),u=l.substr(++h,l.length).trim();'"'==u[0]&&(u=u.slice(1,-1)),void 0==s[d]&&(s[d]=function(e,t){try{return t(e)}catch(t){return e}}(u,a))}}return s},t.serialize=function(e,t,i){var n=i||{},a=n.encode||r;if("function"!=typeof a)throw TypeError("option encode is invalid");if(!s.test(e))throw TypeError("argument name is invalid");var o=a(t);if(o&&!s.test(o))throw TypeError("argument val is invalid");var l=e+"="+o;if(null!=n.maxAge){var h=n.maxAge-0;if(isNaN(h)||!isFinite(h))throw TypeError("option maxAge is invalid");l+="; Max-Age="+Math.floor(h)}if(n.domain){if(!s.test(n.domain))throw TypeError("option domain is invalid");l+="; Domain="+n.domain}if(n.path){if(!s.test(n.path))throw TypeError("option path is invalid");l+="; Path="+n.path}if(n.expires){if("function"!=typeof n.expires.toUTCString)throw TypeError("option expires is invalid");l+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(l+="; HttpOnly"),n.secure&&(l+="; Secure"),n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:case"strict":l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"none":l+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return l};var e=decodeURIComponent,r=encodeURIComponent,i=/; */,s=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/})(),e.exports=t})()},"./dist/compiled/fresh/index.js":e=>{(()=>{"use strict";var t={695:e=>{/*!
* fresh
* Copyright(c) 2012 TJ Holowaychuk
* Copyright(c) 2016-2017 Douglas Christopher Wilson
* MIT Licensed
*/var t=/(?:^|,)\s*?no-cache\s*?(?:,|$)/;function r(e){var t=e&&Date.parse(e);return"number"==typeof t?t:NaN}e.exports=function(e,i){var s=e["if-modified-since"],n=e["if-none-match"];if(!s&&!n)return!1;var a=e["cache-control"];if(a&&t.test(a))return!1;if(n&&"*"!==n){var o=i.etag;if(!o)return!1;for(var l=!0,h=function(e){for(var t=0,r=[],i=0,s=0,n=e.length;s<n;s++)switch(e.charCodeAt(s)){case 32:i===t&&(i=t=s+1);break;case 44:r.push(e.substring(i,t)),i=t=s+1;break;default:t=s+1}return r.push(e.substring(i,t)),r}(n),d=0;d<h.length;d++){var u=h[d];if(u===o||u==="W/"+o||"W/"+u===o){l=!1;break}}if(l)return!1}if(s){var c=i["last-modified"];if(!c||!(r(c)<=r(s)))return!1}return!0}}},r={};function i(e){var s=r[e];if(void 0!==s)return s.exports;var n=r[e]={exports:{}},a=!0;try{t[e](n,n.exports,i),a=!1}finally{a&&delete r[e]}return n.exports}i.ab=__dirname+"/";var s=i(695);e.exports=s})()},"./dist/compiled/lru-cache/index.js":e=>{(()=>{"use strict";var t={806:(e,t,r)=>{let i=r(190),s=Symbol("max"),n=Symbol("length"),a=Symbol("lengthCalculator"),o=Symbol("allowStale"),l=Symbol("maxAge"),h=Symbol("dispose"),d=Symbol("noDisposeOnSet"),u=Symbol("lruList"),c=Symbol("cache"),p=Symbol("updateAgeOnGet"),f=()=>1,m=(e,t,r)=>{let i=e[c].get(t);if(i){let t=i.value;if(g(e,t)){if(y(e,i),!e[o])return}else r&&(e[p]&&(i.value.now=Date.now()),e[u].unshiftNode(i));return t.value}},g=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;let r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[l]&&r>e[l]},v=e=>{if(e[n]>e[s])for(let t=e[u].tail;e[n]>e[s]&&null!==t;){let r=t.prev;y(e,t),t=r}},y=(e,t)=>{if(t){let r=t.value;e[h]&&e[h](r.key,r.value),e[n]-=r.length,e[c].delete(r.key),e[u].removeNode(t)}};class x{constructor(e,t,r,i,s){this.key=e,this.value=t,this.length=r,this.now=i,this.maxAge=s||0}}let w=(e,t,r,i)=>{let s=r.value;g(e,s)&&(y(e,r),e[o]||(s=void 0)),s&&t.call(i,s.value,s.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw TypeError("max must be a non-negative number");this[s]=e.max||1/0;let t=e.length||f;if(this[a]="function"!=typeof t?f:t,this[o]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[h]=e.dispose,this[d]=e.noDisposeOnSet||!1,this[p]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw TypeError("max must be a non-negative number");this[s]=e||1/0,v(this)}get max(){return this[s]}set allowStale(e){this[o]=!!e}get allowStale(){return this[o]}set maxAge(e){if("number"!=typeof e)throw TypeError("maxAge must be a non-negative number");this[l]=e,v(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=f),e!==this[a]&&(this[a]=e,this[n]=0,this[u].forEach(e=>{e.length=this[a](e.value,e.key),this[n]+=e.length})),v(this)}get lengthCalculator(){return this[a]}get length(){return this[n]}get itemCount(){return this[u].length}rforEach(e,t){t=t||this;for(let r=this[u].tail;null!==r;){let i=r.prev;w(this,e,r,t),r=i}}forEach(e,t){t=t||this;for(let r=this[u].head;null!==r;){let i=r.next;w(this,e,r,t),r=i}}keys(){return this[u].toArray().map(e=>e.key)}values(){return this[u].toArray().map(e=>e.value)}reset(){this[h]&&this[u]&&this[u].length&&this[u].forEach(e=>this[h](e.key,e.value)),this[c]=new Map,this[u]=new i,this[n]=0}dump(){return this[u].map(e=>!g(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[u]}set(e,t,r){if((r=r||this[l])&&"number"!=typeof r)throw TypeError("maxAge must be a number");let i=r?Date.now():0,o=this[a](t,e);if(this[c].has(e)){if(o>this[s])return y(this,this[c].get(e)),!1;let a=this[c].get(e),l=a.value;return this[h]&&!this[d]&&this[h](e,l.value),l.now=i,l.maxAge=r,l.value=t,this[n]+=o-l.length,l.length=o,this.get(e),v(this),!0}let p=new x(e,t,o,i,r);return p.length>this[s]?(this[h]&&this[h](e,t),!1):(this[n]+=p.length,this[u].unshift(p),this[c].set(e,this[u].head),v(this),!0)}has(e){if(!this[c].has(e))return!1;let t=this[c].get(e).value;return!g(this,t)}get(e){return m(this,e,!0)}peek(e){return m(t
Read more: https://nextjs.org/docs/messages/middleware-request-page
`)}}class tn extends Error{constructor(){super(`The request.ua has been removed in favour of \`userAgent\` function.
Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
`)}}var ta=r("./dist/esm/server/web/spec-extension/cookies.js");let to=Symbol("internal request");class tl extends Request{constructor(e,t={}){let r="string"!=typeof e&&"url"in e?e.url:String(e);(function(e){try{String(new URL(String(e)))}catch(t){throw Error(`URL is malformed "${String(e)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:t})}})(r),e instanceof Request?super(e,t):super(r,t);let i=new ti(r,{headers:e0(this.headers),nextConfig:t.nextConfig});this[to]={cookies:new ta.q(this.headers),geo:t.geo||{},ip:t.ip,nextUrl:i,url:process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE?r:i.toString()}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,geo:this.geo,ip:this.ip,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[to].cookies}get geo(){return this[to].geo}get ip(){return this[to].ip}get nextUrl(){return this[to].nextUrl}get page(){throw new ts}get ua(){throw new tn}get url(){return this[to].url}}let th="ResponseAborted";class td extends Error{constructor(...e){super(...e),this.name=th}}function tu(e){let t=new AbortController;return e.once("close",()=>{e.writableFinished||t.abort(new td)}),t}class tc{static fromBaseNextRequest(e,t){return"request"in e&&e.request?tc.fromWebNextRequest(e):tc.fromNodeNextRequest(e,t)}static fromNodeNextRequest(e,t){let r,i=null;if("GET"!==e.method&&"HEAD"!==e.method&&e.body&&(i=e.body),e.url.startsWith("http"))r=new URL(e.url);else{let t=j(e,"initURL");r=t&&t.startsWith("http")?new URL(e.url,t):new URL(e.url,"http://n")}return new tl(r,{body:i,method:e.method,headers:eQ(e.headers),duplex:"half",signal:t})}static fromWebNextRequest(e){let t=null;return"GET"!==e.method&&"HEAD"!==e.method&&(t=e.body),new tl(e.url,{body:t,method:e.method,headers:eQ(e.headers),duplex:"half",signal:e.request.signal})}}class tp{constructor(){let e,t;this.promise=new Promise((r,i)=>{e=r,t=i}),this.resolve=e,this.reject=t}}function tf(e){return(null==e?void 0:e.name)==="AbortError"||(null==e?void 0:e.name)===th}async function tm(e,t,r){try{let{errored:i,destroyed:s}=t;if(i||s)return;let n=tu(t),a=function(e,t){let r=!1,i=new tp;function s(){i.resolve()}e.on("drain",s),e.once("close",()=>{e.off("drain",s),i.resolve()});let n=new tp;return e.once("finish",()=>{n.resolve()}),new WritableStream({write:async t=>{r||(r=!0,e.flushHeaders());try{let r=e.write(t);"flush"in e&&"function"==typeof e.flush&&e.flush(),r||(await i.promise,i=new tp)}catch(t){throw e.end(),Error("failed to write chunk to response",{cause:t})}},abort:t=>{e.writableFinished||e.destroy(t)},close:async()=>{if(t&&await t,!e.writableFinished)return e.end(),n.promise}})}(t,r);await e.pipeTo(a,{signal:n.signal})}catch(e){if(tf(e))return;throw Error("failed to pipe response",{cause:e})}}class tg{static fromStatic(e){return new tg(e,{metadata:{}})}constructor(e,{contentType:t,waitUntil:r,metadata:i}){this.response=e,this.contentType=t,this.metadata=i,this.waitUntil=r}assignMetadata(e){Object.assign(this.metadata,e)}get isNull(){return null===this.response}get isDynamic(){return"string"!=typeof this.response}toUnchunkedString(e=!1){if(null===this.response)throw Error("Invariant: null responses cannot be unchunked");if("string"!=typeof this.response){if(!e)throw Error("Invariant: dynamic responses cannot be unchunked. This is a bug in Next.js");return eY(this.readable)}return this.response}get readable(){if(null===this.response)throw Error("Invariant: null responses cannot be streamed");if("string"==typeof this.response)throw Error("Invariant: static responses cannot be streamed");return Array.isArray(this.response)?function(...e){let{readable:t,writable:r}=new TransformStream,i=Promise.resolve();for(let t=0;t<e.length;++t)i=i.then(()=>e[t].pipeTo(r,{preve
See here for info: https://nextjs.org/docs/messages/custom-error-no-custom-404`)});let{dir:n=".",quiet:a=!1,conf:o,dev:l=!1,minimalMode:h=!1,customServer:d=!0,hostname:u,port:c}=e;this.serverOptions=e,this.dir=r("path").resolve(n),this.quiet=a,this.loadEnvConfig({dev:l}),this.nextConfig=o,this.hostname=u,this.hostname&&(this.fetchHostname=function(e){return e$.test(e)?`[${e}]`:e}(this.hostname)),this.port=c,this.distDir=r("path").join(this.dir,this.nextConfig.distDir),this.publicDir=this.getPublicDir(),this.hasStaticDir=!h&&this.getHasStaticDir(),this.i18nProvider=(null==(t=this.nextConfig.i18n)?void 0:t.locales)?new re(this.nextConfig.i18n):void 0,this.localeNormalizer=this.i18nProvider?new tD(this.i18nProvider):void 0;let{serverRuntimeConfig:p={},publicRuntimeConfig:f,assetPrefix:m,generateEtags:g}=this.nextConfig;this.buildId=this.getBuildId(),this.minimalMode=h||!!process.env.NEXT_PRIVATE_MINIMAL_MODE,this.enabledDirectories=this.getEnabledDirectories(l),this.normalizers={postponed:this.enabledDirectories.app&&this.nextConfig.experimental.ppr?new ro:void 0,rsc:this.enabledDirectories.app?new rn:void 0,prefetchRSC:this.enabledDirectories.app&&this.nextConfig.experimental.ppr?new rh:void 0,data:this.enabledDirectories.pages?new rd(this.buildId):void 0},this.nextFontManifest=this.getNextFontManifest(),process.env.NEXT_DEPLOYMENT_ID=this.nextConfig.experimental.deploymentId||"",this.renderOpts={trailingSlash:this.nextConfig.trailingSlash,deploymentId:this.nextConfig.experimental.deploymentId,strictNextHead:!!this.nextConfig.experimental.strictNextHead,poweredByHeader:this.nextConfig.poweredByHeader,canonicalBase:this.nextConfig.amp.canonicalBase||"",buildId:this.buildId,generateEtags:g,previewProps:this.getPrerenderManifest().preview,customServer:!0===d||void 0,ampOptimizerConfig:null==(i=this.nextConfig.experimental.amp)?void 0:i.optimizer,basePath:this.nextConfig.basePath,images:this.nextConfig.images,optimizeFonts:this.nextConfig.optimizeFonts,fontManifest:this.nextConfig.optimizeFonts&&!l?this.getFontManifest():void 0,optimizeCss:this.nextConfig.experimental.optimizeCss,nextConfigOutput:this.nextConfig.output,nextScriptWorkers:this.nextConfig.experimental.nextScriptWorkers,disableOptimizedLoading:this.nextConfig.experimental.disableOptimizedLoading,domainLocales:null==(s=this.nextConfig.i18n)?void 0:s.domains,distDir:this.distDir,serverComponents:this.enabledDirectories.app,enableTainting:this.nextConfig.experimental.taint,crossOrigin:this.nextConfig.crossOrigin?this.nextConfig.crossOrigin:void 0,largePageDataBytes:this.nextConfig.experimental.largePageDataBytes,runtimeConfig:Object.keys(f).length>0?f:void 0,isExperimentalCompile:this.nextConfig.experimental.isExperimentalCompile,experimental:{ppr:this.enabledDirectories.app&&!0===this.nextConfig.experimental.ppr,missingSuspenseWithCSRBailout:!0===this.nextConfig.experimental.missingSuspenseWithCSRBailout}},(0,eV.setConfig)({serverRuntimeConfig:p,publicRuntimeConfig:f}),this.pagesManifest=this.getPagesManifest(),this.appPathsManifest=this.getAppPathsManifest(),this.appPathRoutes=this.getAppPathRoutes(),this.matchers=this.getRouteMatchers(),this.matchers.reload(),this.setAssetPrefix(m),this.responseCache=this.getResponseCache({dev:l})}reloadMatchers(){return this.matchers.reload()}getRouteMatchers(){let e=new t7(e=>{switch(e){case H:return this.getPagesManifest()??null;case $:return this.getAppPathsManifest()??null;default:return null}}),t=new tj;return t.push(new t6(this.distDir,e,this.i18nProvider)),t.push(new t2(this.distDir,e,this.i18nProvider)),this.enabledDirectories.app&&(t.push(new tJ(this.distDir,e)),t.push(new tQ(this.distDir,e))),t}logError(e){this.quiet||eT(e)}async handleRequest(e,t,r){await this.prepare();let i=e.method.toUpperCase(),s=(0,eJ.getTracer)();return s.withPropagatedContext(e.headers,()=>s.trace(o.handleRequest,{spanName:`${i} ${e.url}`,kind:eJ.SpanKind.SERVER,attributes:{"http.method":i,"http.target":e.url}},async n=>this.handleRequestImpl(e,t,r).finally(()=>{if(!n)return;n.setAttributes({"http.status_code":t.statusCode});let e=s.getRootSpan
see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`);if(null==e?void 0:e.stack){let r=e.stack;t.stack=t.message+r.substring(r.indexOf("\n"))}throw t}return"isNotFound"in f&&f.isNotFound?{value:null,revalidate:f.revalidate}:f.isRedirect?{value:{kind:"REDIRECT",props:f.pageData??f.flightData},revalidate:f.revalidate}:n.isNull?null:{value:{kind:"PAGE",html:n,pageData:f.pageData??f.flightData,postponed:f.postponed,headers:m,status:b?t.statusCode:void 0},revalidate:f.revalidate}},Q=await this.responseCache.get(G,async(r,n,l)=>{r||t.sent,m||({staticPaths:m,fallbackMode:g}=_?await this.getStaticPaths({pathname:i,requestHeaders:e.headers,isAppPath:b,page:a.page}):{staticPaths:void 0,fallbackMode:!1}),"static"===g&&eX(e.headers["user-agent"]||"")&&(g="blocking"),(null==n?void 0:n.isStale)===-1&&(W=!0),W&&(!1!==g||n)&&(g="blocking");let h=G??(s.dev&&b?A:null);h&&o.amp&&(h=h.replace(/\.amp$/,"")),h&&(null==m||m.includes(h)),this.nextConfig.experimental.isExperimentalCompile&&(g="blocking");let d=await Y({postponed:W||l||!I?void 0:I});return d?{...d,revalidate:void 0!==d.revalidate?d.revalidate:1}:null},{routeKind:null==J?void 0:J.definition.kind,incrementalCache:X,isOnDemandRevalidate:W,isPrefetch:"prefetch"===e.headers.purpose});if(!Q){if(G&&!(W&&K))throw Error("invariant: cache entry required but not generated");return null}(null==(u=Q.value)?void 0:u.kind)==="PAGE"&&Q.value.postponed;let{value:Z}=Q;if((null==Z?void 0:Z.kind)==="IMAGE")throw Error("invariant SSG should not return an image cache value");if(I)v=0;else if(L&&!k&&s.experimental.ppr)v=0;else if(void 0!==Q.revalidate){if(z||y&&!O)v=0;else if(P){if("number"==typeof Q.revalidate){if(Q.revalidate<1)throw Error(`Invariant: invalid Cache-Control duration provided: ${Q.revalidate} < 1`);v=Q.revalidate}else!1===Q.revalidate&&(v=et.BR)}else t.getHeader("Cache-Control")||(v=0)}Q.revalidate=v;let ee=j(e,"onCacheEntry");if(ee){let t=await ee(Q,{url:j(e,"initURL")});if(t)return null}if(Z){if("REDIRECT"===Z.kind)return(Q.revalidate&&t.setHeader("Cache-Control",er(Q.revalidate)),O)?{type:"json",body:tg.fromStatic(JSON.stringify(Z.props)),revalidate:Q.revalidate}:(await (e=>{let r={destination:e.pageProps.__N_REDIRECT,statusCode:e.pageProps.__N_REDIRECT_STATUS,basePath:e.pageProps.__N_REDIRECT_BASE_PATH},i=r.statusCode||(r.permanent?n.PermanentRedirect:n.TemporaryRedirect),{basePath:s}=this.nextConfig;s&&!1!==r.basePath&&r.destination.startsWith("/")&&(r.destination=`${s}${r.destination}`),r.destination.startsWith("/")&&(r.destination=(0,T.U3)(r.destination)),t.redirect(r.destination,i).body(r.destination).send()})(Z.props),null);if("ROUTE"===Z.kind){let r={...Z.headers};return P||delete r[et.Et],await rt(e,t,new Response(Z.body,{headers:eQ(r),status:Z.status||200})),null}if(b){if(Z.postponed&&I)throw Error("Invariant: postponed state should not be present on a resume request");if(Z.headers){let e={...Z.headers};for(let[r,i]of(P||delete e[et.Et],Object.entries(e)))if(void 0!==i){if(Array.isArray(i))for(let e of i)t.appendHeader(r,e);else"number"==typeof i&&(i=i.toString()),t.appendHeader(r,i)}}if(P&&(null==(p=Z.headers)?void 0:p[et.Et])&&t.setHeader(et.Et,Z.headers[et.Et]),Z.status&&(t.statusCode=Z.status),Z.postponed&&L&&t.setHeader("x-nextjs-postponed","1"),O&&!z){if(q){if(Z.pageData)throw Error("Invariant: Expected pageData to be undefined");if(Z.postponed)throw Error("Invariant: Expected postponed to be undefined");return{type:"rsc",body:Z.html,revalidate:0}}if("string"!=typeof Z.pageData)throw Error(`Invariant: expected pageData to be a string, got ${typeof Z.pageData}`);return{type:"rsc",body:tg.fromStatic(Z.pageData),revalidate:Q.revalidate}}let e=Z.html;return Z.postponed,{type:"html",body:e,revalidate:Q.revalidate}}return O?{type:"json",body:tg.fromStatic(JSON.stringify(Z.pageData)),revalidate:Q.revalidate}:{type:"html",body:Z.html,revalidate:Q.revalidate}}return(Q.revalidate&&t.setHeader("Cache-Control",er(Q.revalidate)),O)?(t.statusCode=404,t.body('{"notFound":true}').send()):await this.render404(e,t,{pathname:i,query:o},!1),null}stripNextDataPath(
//# sourceMappingURL=server.runtime.prod.js.map