next 15.1.1-canary.3 → 15.1.1-canary.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of next might be problematic. Click here for more details.
- package/dist/bin/next +1 -1
- package/dist/build/index.js +2 -2
- package/dist/build/swc/index.js +1 -1
- package/dist/build/utils.js +6 -3
- package/dist/build/utils.js.map +1 -1
- package/dist/build/webpack-config.js +2 -2
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/index.js +1 -1
- package/dist/compiled/next-server/server.runtime.prod.js +1 -1
- package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
- package/dist/esm/build/index.js +2 -2
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/utils.js +6 -3
- package/dist/esm/build/utils.js.map +1 -1
- package/dist/esm/build/webpack-config.js +2 -2
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/export/worker.js +2 -1
- package/dist/esm/export/worker.js.map +1 -1
- package/dist/esm/server/config.js +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/esm/server/dev/static-paths-worker.js +2 -1
- package/dist/esm/server/dev/static-paths-worker.js.map +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/esm/server/load-components.js +13 -8
- package/dist/esm/server/load-components.js.map +1 -1
- package/dist/esm/server/next-server.js +11 -5
- package/dist/esm/server/next-server.js.map +1 -1
- package/dist/export/worker.js +2 -1
- package/dist/export/worker.js.map +1 -1
- package/dist/server/config.js +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/server/dev/static-paths-worker.js +2 -1
- package/dist/server/dev/static-paths-worker.js.map +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/server/load-components.d.ts +2 -1
- package/dist/server/load-components.js +13 -8
- package/dist/server/load-components.js.map +1 -1
- package/dist/server/next-server.d.ts +1 -0
- package/dist/server/next-server.js +11 -5
- package/dist/server/next-server.js.map +1 -1
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/package.json +15 -15
|
@@ -1489,7 +1489,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1489
1489
|
isClient && new _copyfileplugin.CopyFilePlugin({
|
|
1490
1490
|
// file path to build output of `@next/polyfill-nomodule`
|
|
1491
1491
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
|
1492
|
-
cacheKey: "15.1.1-canary.
|
|
1492
|
+
cacheKey: "15.1.1-canary.4",
|
|
1493
1493
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
|
1494
1494
|
minimize: false,
|
|
1495
1495
|
info: {
|
|
@@ -1717,7 +1717,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1717
1717
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
|
1718
1718
|
// - Next.js version
|
|
1719
1719
|
// - next.config.js keys that affect compilation
|
|
1720
|
-
version: `${__dirname}|${"15.1.1-canary.
|
|
1720
|
+
version: `${__dirname}|${"15.1.1-canary.4"}|${configVars}`,
|
|
1721
1721
|
cacheDirectory: _path.default.join(distDir, 'cache', 'webpack'),
|
|
1722
1722
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
|
1723
1723
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|
package/dist/client/index.js
CHANGED
|
@@ -62,7 +62,7 @@ const _shared = require("./react-client-callbacks/shared");
|
|
|
62
62
|
const _tracer = /*#__PURE__*/ _interop_require_default._(require("./tracing/tracer"));
|
|
63
63
|
const _reporttosocket = /*#__PURE__*/ _interop_require_default._(require("./tracing/report-to-socket"));
|
|
64
64
|
const _isnextroutererror = require("./components/is-next-router-error");
|
|
65
|
-
const version = "15.1.1-canary.
|
|
65
|
+
const version = "15.1.1-canary.4";
|
|
66
66
|
let router;
|
|
67
67
|
const emitter = (0, _mitt.default)();
|
|
68
68
|
const looseToArray = (input)=>[].slice.call(input);
|
|
@@ -2869,5 +2869,5 @@ ${B}`)}function a(t,r){let s;let{stackTraceLimit:n,prepareStackTrace:a}=Error;if
|
|
|
2869
2869
|
`)}}var rv=__webpack_require__("./dist/esm/server/web/spec-extension/cookies.js");let rE=Symbol("internal request");class rj extends Request{constructor(t,r={}){let s="string"!=typeof t&&"url"in t?t.url:String(t);rs(s),t instanceof Request?super(t,r):super(s,r);let n=new rg(s,{headers:rr(this.headers),nextConfig:r.nextConfig});this[rE]={cookies:new rv.tm(this.headers),nextUrl:n,url:process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE?s:n.toString()}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,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[rE].cookies}get nextUrl(){return this[rE].nextUrl}get page(){throw new rD}get ua(){throw new rx}get url(){return this[rE].url}}let rA=t=>!0,rS=t=>!0,rP="ResponseAborted";class r_ extends Error{constructor(...t){super(...t),this.name=rP}}function rw(t){let r=new AbortController;return t.once("close",()=>{t.writableFinished||r.abort(new r_)}),r}function rO(t){let{errored:r,destroyed:s}=t;if(r||s)return AbortSignal.abort(r??new r_);let{signal:n}=rw(t);return n}class rI{static fromBaseNextRequest(t,r){if(rA(t))return rI.fromNodeNextRequest(t,r);throw Object.defineProperty(Error("Invariant: Unsupported NextRequest type"),"__NEXT_ERROR_CODE",{value:"E345",enumerable:!1})}static fromNodeNextRequest(t,r){let s,n=null;if("GET"!==t.method&&"HEAD"!==t.method&&t.body&&(n=t.body),t.url.startsWith("http"))s=new URL(t.url);else{let r=eE(t,"initURL");s=r&&r.startsWith("http")?new URL(t.url,r):new URL(t.url,"http://n")}return new rj(s,{method:t.method,headers:re(t.headers),duplex:"half",signal:r,...r.aborted?{}:{body:n}})}static fromWebNextRequest(t){let r=null;return"GET"!==t.method&&"HEAD"!==t.method&&(r=t.body),new rj(t.url,{method:t.method,headers:re(t.headers),duplex:"half",signal:t.request.signal,...t.request.signal.aborted?{}:{body:r}})}}let rT=0,rN=0,rF=0;function rk(t={}){let r=0===rT?void 0:{clientComponentLoadStart:rT,clientComponentLoadTimes:rN,clientComponentLoadCount:rF};return t.reset&&(rT=0,rN=0,rF=0),r}function rM(t){return(null==t?void 0:t.name)==="AbortError"||(null==t?void 0:t.name)===rP}function rR(t,r){let s=!1,n=new tZ;function a(){n.resolve()}t.on("drain",a),t.once("close",()=>{t.off("drain",a),n.resolve()});let i=new tZ;return t.once("finish",()=>{i.resolve()}),new WritableStream({write:async r=>{if(!s){if(s=!0,"performance"in globalThis&&process.env.NEXT_OTEL_PERFORMANCE_PREFIX){let t=rk();t&&performance.measure(`${process.env.NEXT_OTEL_PERFORMANCE_PREFIX}:next-client-component-loading`,{start:t.clientComponentLoadStart,end:t.clientComponentLoadStart+t.clientComponentLoadTimes})}t.flushHeaders(),(0,t0.getTracer)().trace(t2.Fx.startResponse,{spanName:"start response"},()=>void 0)}try{let s=t.write(r);"flush"in t&&"function"==typeof t.flush&&t.flush(),s||(await n.promise,n=new tZ)}catch(r){throw t.end(),Object.defineProperty(Error("failed to write chunk to response",{cause:r}),"__NEXT_ERROR_CODE",{value:"E321",enumerable:!1})}},abort:r=>{t.writableFinished||t.destroy(r)},close:async()=>{if(r&&await r,!t.writableFinished)return t.end(),i.promise}})}async function rL(t,r,s){try{let{errored:n,destroyed:a}=r;if(n||a)return;let i=rw(r),o=rR(r,s);await t.pipeTo(o,{signal:i.signal})}catch(t){if(rM(t))return;throw Object.defineProperty(Error("failed to pipe response",{cause:t}),"__NEXT_ERROR_CODE",{value:"E180",enumerable:!1})}}class rH{static fromStatic(t){return new rH(t,{metadata:{}})}constructor(t,{contentType:r,waitUntil:s,metadata:n}){this.response=t,this.contentType=r,this.metadata=n,this.waitUntil=s}assignMetadata(t){Object.assign(this.metadata,t)}get isNull(){return null===this.response}get isDynamic(){return"string"!=typeof this.response}toUnchunkedBuffer(t=!1){if(null===this.response)throw Object.defineProperty(Error("Invariant: null responses cannot be unchunked"),"__NEXT_ERROR_CODE",{value:"E274",enumerable:!1});if("string"!=typeof this.response){if(!t)throw Object.defineProperty(Error("Invariant: dynamic responses cannot be unchunked. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E81",enumerable:!1});return t9(this.readable)}return Buffer.from(this.response)}toUnchunkedString(t=!1){if(null===this.response)throw Object.defineProperty(Error("Invariant: null responses cannot be unchunked"),"__NEXT_ERROR_CODE",{value:"E274",enumerable:!1});if("string"!=typeof this.response){if(!t)throw Object.defineProperty(Error("Invariant: dynamic responses cannot be unchunked. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E81",enumerable:!1});return t8(this.readable)}return this.response}get readable(){if(null===this.response)throw Object.defineProperty(Error("Invariant: null responses cannot be streamed"),"__NEXT_ERROR_CODE",{value:"E14",enumerable:!1});if("string"==typeof this.response)throw Object.defineProperty(Error("Invariant: static responses cannot be streamed"),"__NEXT_ERROR_CODE",{value:"E151",enumerable:!1});return Buffer.isBuffer(this.response)?t7(this.response):Array.isArray(this.response)?t4(...this.response):this.response}chain(t){let r;if(null===this.response)throw Object.defineProperty(Error("Invariant: response is null. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E258",enumerable:!1});"string"==typeof this.response?r=[t6(this.response)]:Array.isArray(this.response)?r=this.response:Buffer.isBuffer(this.response)?r=[t7(this.response)]:r=[this.response],r.push(t),this.response=r}async pipeTo(t){try{await this.readable.pipeTo(t,{preventClose:!0}),this.waitUntil&&await this.waitUntil,await t.close()}catch(r){if(rM(r)){await t.abort(r);return}throw r}}async pipeToNodeResponse(t){await rL(this.readable,t,this.waitUntil)}}var rG=/*#__PURE__*/function(t){return t.PAGES="PAGES",t.PAGES_API="PAGES_API",t.APP_PAGE="APP_PAGE",t.APP_ROUTE="APP_ROUTE",t.IMAGE="IMAGE",t}({});async function rK(t){var r,s;return{...t,value:(null==(r=t.value)?void 0:r.kind)===tY.PAGES?{kind:tY.PAGES,html:await t.value.html.toUnchunkedString(!0),pageData:t.value.pageData,headers:t.value.headers,status:t.value.status}:(null==(s=t.value)?void 0:s.kind)===tY.APP_PAGE?{kind:tY.APP_PAGE,html:await t.value.html.toUnchunkedString(!0),postponed:t.value.postponed,rscData:t.value.rscData,headers:t.value.headers,status:t.value.status,segmentData:t.value.segmentData}:t.value}}async function rJ(t){var r,s,n;if(!t)return null;if((null==(r=t.value)?void 0:r.kind)===tY.FETCH)throw Object.defineProperty(Error("Invariant: unexpected cachedResponse of kind fetch in response cache"),"__NEXT_ERROR_CODE",{value:"E165",enumerable:!1});return{isMiss:t.isMiss,isStale:t.isStale,revalidate:t.revalidate,isFallback:t.isFallback,value:(null==(s=t.value)?void 0:s.kind)===tY.PAGES?{kind:tY.PAGES,html:rH.fromStatic(t.value.html),pageData:t.value.pageData,headers:t.value.headers,status:t.value.status}:(null==(n=t.value)?void 0:n.kind)===tY.APP_PAGE?{kind:tY.APP_PAGE,html:rH.fromStatic(t.value.html),rscData:t.value.rscData,headers:t.value.headers,status:t.value.status,postponed:t.value.postponed,segmentData:t.value.segmentData}:t.value}}function rU(t){switch(t){case rG.PAGES:return tz.PAGES;case rG.APP_PAGE:return tz.APP_PAGE;case rG.IMAGE:return tz.IMAGE;case rG.APP_ROUTE:return tz.APP_ROUTE;default:throw Object.defineProperty(Error(`Unexpected route kind ${t}`),"__NEXT_ERROR_CODE",{value:"E64",enumerable:!1})}}class rQ{constructor(t){this.batcher=t$.create({cacheKeyFn:({key:t,isOnDemandRevalidate:r})=>`${t}-${r?"1":"0"}`,schedulerFn:t1}),this.minimalMode=t}async get(t,r,s){if(!t)return r({hasResolved:!1,previousCacheEntry:null});let{incrementalCache:n,isOnDemandRevalidate:a=!1,isFallback:i=!1,isRoutePPREnabled:o=!1}=s;return rJ(await this.batcher.batch({key:t,isOnDemandRevalidate:a},async(B,l)=>{var u;if((null==(u=this.previousCacheItem)?void 0:u.key)===B&&this.previousCacheItem.expiresAt>Date.now())return this.previousCacheItem.entry;rU(s.routeKind);let c=!1,d=null;try{d=null;let t=await r({hasResolved:c,previousCacheEntry:d,isRevalidating:!0});if(!t)return this.previousCacheItem=void 0,null;let s=await rK({...t,isMiss:!d});if(!s)return this.previousCacheItem=void 0,null;return a||c||(l(s),c=!0),void 0!==s.revalidate&&(this.previousCacheItem={key:B,entry:s,expiresAt:Date.now()+1e3}),s}catch(r){if(d&&await n.set(t,d.value,{revalidate:Math.min(Math.max(d.revalidate||3,3),30),isRoutePPREnabled:o,isFallback:i}),c)return console.error(r),null;throw r}}))}}let rW="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",rV=`(${rW}[.]){3}${rW}`,rq="(?:[0-9a-fA-F]{1,4})",rX=RegExp(`^((?:${rq}:){7}(?:${rq}|:)|(?:${rq}:){6}(?:${rV}|:${rq}|:)|(?:${rq}:){5}(?::${rV}|(:${rq}){1,2}|:)|(?:${rq}:){4}(?:(:${rq}){0,1}:${rV}|(:${rq}){1,3}|:)|(?:${rq}:){3}(?:(:${rq}){0,2}:${rV}|(:${rq}){1,4}|:)|(?:${rq}:){2}(?:(:${rq}){0,3}:${rV}|(:${rq}){1,5}|:)|(?:${rq}:){1}(?:(:${rq}){0,4}:${rV}|(:${rq}){1,6}|:)|(?::((?::${rq}){0,5}:${rV}|(?::${rq}){1,7}|:)))(%[0-9a-zA-Z-.:]{1,})?$`);function rY(t){return rX.test(t)}function rz(t){return rY(t)?`[${t}]`:t}function rZ(t){return t.statusCode||(t.permanent?ez.PermanentRedirect:ez.TemporaryRedirect)}function r$(t){return t===e7.li.experimentalEdge||t===e7.li.edge}let r1=/\/\[[^/]+?\](?=\/|$)/;function r0(t){return tN(t)&&(t=tF(t).interceptedRoute),r1.test(t)}let r2=require("next/dist/shared/lib/runtime-config.external.js");function r3(t){return eK.includes(t)}let r5=/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i;function r4(t){return r5.test(t)}function r6(t){return t.replace(/\\/g,"/")}function r7(t){let r=r6(t);return r.startsWith("/index/")&&!r0(r)?r.slice(6):"/index"!==r?r:"/"}var r9=__webpack_require__("./dist/compiled/path-to-regexp/index.js");function r8(t,r){let s=[],n=(0,r9.pathToRegexp)(t,s,{delimiter:"/",sensitive:"boolean"==typeof(null==r?void 0:r.sensitive)&&r.sensitive,strict:null==r?void 0:r.strict}),a=(0,r9.regexpToFunction)((null==r?void 0:r.regexModifier)?new RegExp(r.regexModifier(n.source),n.flags):n,s);return(t,n)=>{if("string"!=typeof t)return!1;let i=a(t);if(!i)return!1;if(null==r?void 0:r.removeUnnamedParams)for(let t of s)"number"==typeof t.name&&delete i.params[t.name];return{...n,...i.params}}}function se(t){let r="";for(let s=0;s<t.length;s++){let n=t.charCodeAt(s);(n>64&&n<91||n>96&&n<123)&&(r+=t[s])}return r}function st(t,r){return t.replace(RegExp(":"+tR(r),"g"),"__ESC_COLON_"+r)}function sr(t){return t.replace(/__ESC_COLON_/gi,":")}function ss(t,r,s,n){void 0===s&&(s=[]),void 0===n&&(n=[]);let a={},i=s=>{let n;let i=s.key;switch(s.type){case"header":i=i.toLowerCase(),n=t.headers[i];break;case"cookie":n="cookies"in t?t.cookies[s.key]:eZ(t.headers)()[s.key];break;case"query":n=r[i];break;case"host":{let{host:r}=(null==t?void 0:t.headers)||{};n=null==r?void 0:r.split(":",1)[0].toLowerCase()}}if(!s.value&&n)return a[se(i)]=n,!0;if(n){let t=RegExp("^"+s.value+"$"),r=Array.isArray(n)?n.slice(-1)[0].match(t):n.match(t);if(r)return Array.isArray(r)&&(r.groups?Object.keys(r.groups).forEach(t=>{a[t]=r.groups[t]}):"host"===s.type&&r[0]&&(a.host=r[0])),!0}return!1};return!!s.every(t=>i(t))&&!n.some(t=>i(t))&&a}function sn(t,r){if(!t.includes(":"))return t;for(let s of Object.keys(r))t.includes(":"+s)&&(t=t.replace(RegExp(":"+s+"\\*","g"),":"+s+"--ESCAPED_PARAM_ASTERISKS").replace(RegExp(":"+s+"\\?","g"),":"+s+"--ESCAPED_PARAM_QUESTION").replace(RegExp(":"+s+"\\+","g"),":"+s+"--ESCAPED_PARAM_PLUS").replace(RegExp(":"+s+"(?!\\w)","g"),"--ESCAPED_PARAM_COLON"+s));return t=t.replace(/(:|\*|\?|\+|\(|\)|\{|\})/g,"\\$1").replace(/--ESCAPED_PARAM_PLUS/g,"+").replace(/--ESCAPED_PARAM_COLON/g,":").replace(/--ESCAPED_PARAM_QUESTION/g,"?").replace(/--ESCAPED_PARAM_ASTERISKS/g,"*"),(0,r9.compile)("/"+t,{validate:!1})(r).slice(1)}function sa(t){let r;let s=Object.assign({},t.query);delete s.__nextLocale,delete s.__nextDefaultLocale,delete s.__nextDataReq,delete s.__nextInferredLocaleFromDefault,delete s[to];let n=t.destination;for(let r of Object.keys({...t.params,...s}))n=r?st(n,r):n;let a=tC(n),i=a.query,o=sr(""+a.pathname+(a.hash||"")),B=sr(a.hostname||""),l=[],u=[];(0,r9.pathToRegexp)(o,l),(0,r9.pathToRegexp)(B,u);let c=[];l.forEach(t=>c.push(t.name)),u.forEach(t=>c.push(t.name));let d=(0,r9.compile)(o,{validate:!1}),p=(0,r9.compile)(B,{validate:!1});for(let[r,s]of Object.entries(i))Array.isArray(s)?i[r]=s.map(r=>sn(sr(r),t.params)):"string"==typeof s&&(i[r]=sn(sr(s),t.params));let C=Object.keys(t.params).filter(t=>"nextInternalLocale"!==t);if(t.appendParamsToQuery&&!C.some(t=>c.includes(t)))for(let r of C)r in i||(i[r]=t.params[r]);if(tN(o))for(let r of o.split("/")){let s=tT.find(t=>r.startsWith(t));if(s){"(..)(..)"===s?(t.params["0"]="(..)",t.params["1"]="(..)"):t.params["0"]=s;break}}try{let[s,n]=(r=d(t.params)).split("#",2);a.hostname=p(t.params),a.pathname=s,a.hash=(n?"#":"")+(n||""),delete a.search}catch(t){if(t.message.match(/Expected .*? to not repeat, but got an array/))throw Object.defineProperty(Error("To use a multi-match in the destination you must add `*` at the end of the param name to signify it should repeat. https://nextjs.org/docs/messages/invalid-multi-match"),"__NEXT_ERROR_CODE",{value:"E329",enumerable:!1});throw t}return a.query={...s,...a.query},{newUrl:r,destQuery:i,parsedDestination:a}}function si(t,r,s,n,a){if(n&&r&&a){let r=(0,d.parse)(t.url,!0);for(let t of(delete r.search,Object.keys(r.query))){let n=t!==e7.AA&&t.startsWith(e7.AA),i=t!==e7.h&&t.startsWith(e7.h);(n||i||(s||Object.keys(a.groups)).includes(t))&&delete r.query[t]}t.url=(0,d.format)(r)}}function so(t,r,s){if(!s)return t;for(let n of Object.keys(s.groups)){let a;let{optional:i,repeat:o}=s.groups[n],B=`[${o?"...":""}${n}]`;i&&(B=`[${B}]`);let l=r[n];a=Array.isArray(l)?l.map(t=>t&&encodeURIComponent(t)).join("/"):l?encodeURIComponent(l):"",t=t.replaceAll(B,a)}return t}function sB(t,r,s,n){let a=!0;return s?{params:t=Object.keys(s.groups).reduce((i,o)=>{let B=t[o];"string"==typeof B&&(B=tI(B)),Array.isArray(B)&&(B=B.map(t=>("string"==typeof t&&(t=tI(t)),t)));let l=n[o],u=s.groups[o].optional;return((Array.isArray(l)?l.some(t=>Array.isArray(B)?B.some(r=>r.includes(t)):null==B?void 0:B.includes(t)):null==B?void 0:B.includes(l))||void 0===B&&!(u&&r))&&(a=!1),u&&(!B||Array.isArray(B)&&1===B.length&&("index"===B[0]||B[0]===`[[...${o}]]`))&&(B=void 0,delete t[o]),B&&"string"==typeof B&&s.groups[o].repeat&&(B=B.split("/")),B&&(i[o]=B),i},{}),hasValidParams:a}:{params:t,hasValidParams:!1}}function sl({page:t,i18n:r,basePath:s,rewrites:n,pageIsDynamic:a,trailingSlash:i,caseSensitive:o}){let B,l,u;function c(t,s,n){return ex(function(){let{groups:t,routeKeys:a}=B;return{re:{exec:i=>{let o=Object.fromEntries(new URLSearchParams(i)),B=r&&n&&o["1"]===n;for(let t of Object.keys(o)){let r=o[t];t!==e7.AA&&t.startsWith(e7.AA)&&(o[t.substring(e7.AA.length)]=r,delete o[t])}let l=Object.keys(a||{}),u=t=>{if(r){let a=Array.isArray(t),i=a?t[0]:t;if("string"==typeof i&&r.locales.some(t=>t.toLowerCase()===i.toLowerCase()&&(n=t,s.locale=n,!0)))return a&&t.splice(0,1),!a||0===t.length}return!1};return l.every(t=>o[t])?l.reduce((r,s)=>{let n=null==a?void 0:a[s];return n&&!u(o[s])&&(r[t[n].pos]=o[s]),r},{}):Object.keys(o).reduce((t,r)=>{if(!u(o[r])){let s=r;return B&&(s=parseInt(r,10)-1+""),Object.assign(t,{[s]:o[r]})}return t},{})}},groups:t}}())(t.headers["x-now-route-matches"])}return a&&(u=(l=ex(B=tV(t,!1)))(t)),{handleRewrites:function(B,u){let c={},d=u.pathname,p=()=>{let r=tL(d||"");return r===tL(t)||(null==l?void 0:l(r))},C=n=>{let p=r8(n.source+(i?"(/)?":""),{removeUnnamedParams:!0,strict:!0,sensitive:!!o})(u.pathname);if((n.has||n.missing)&&p){let t=ss(B,u.query,n.has,n.missing);t?Object.assign(p,t):p=!1}if(p){let{parsedDestination:i,destQuery:o}=sa({appendParamsToQuery:!0,destination:n.destination,params:p,query:u.query});if(i.protocol)return!0;if(Object.assign(c,o,p),Object.assign(u.query,i.query),delete i.query,Object.assign(u,i),d=u.pathname,s&&(d=d.replace(RegExp(`^${s}`),"")||"/"),r){let t=rp(d,r.locales);d=t.pathname,u.query.nextInternalLocale=t.detectedLocale||p.nextInternalLocale}if(d===t)return!0;if(a&&l){let t=l(d);if(t)return u.query={...u.query,...t},!0}}return!1};for(let t of n.beforeFiles||[])C(t);if(d!==t){let t=!1;for(let r of n.afterFiles||[])if(t=C(r))break;if(!t&&!p()){for(let r of n.fallback||[])if(t=C(r))break}}return c},defaultRouteRegex:B,dynamicRouteMatcher:l,defaultRouteMatches:u,getParamsFromRouteMatches:c,normalizeDynamicRouteParams:(t,r)=>sB(t,r,B,u),normalizeVercelUrl:(t,r,s)=>si(t,r,s,a,B),interpolateDynamicPath:(t,r)=>so(t,r,B)}}function su(t){return Object.prototype.toString.call(t)}function sc(t){if("[object Object]"!==su(t))return!1;let r=Object.getPrototypeOf(t);return null===r||r.hasOwnProperty("isPrototypeOf")}function sd(t){return"object"==typeof t&&null!==t&&"name"in t&&"message"in t}function sp(t){let r=new WeakSet;return JSON.stringify(t,(t,s)=>{if("object"==typeof s&&null!==s){if(r.has(s))return"[Circular]";r.add(s)}return s})}function sC(t){return sd(t)?t:Object.defineProperty(Error(sc(t)?sp(t):t+""),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1})}class sf{constructor(t){this.provider=t}normalize(t){return this.provider.analyze(t).pathname}}class sm{insert(t){this._insert(t.split("/").filter(Boolean),[],!1)}smoosh(){return this._smoosh()}_smoosh(t){void 0===t&&(t="/");let r=[...this.children.keys()].sort();null!==this.slugName&&r.splice(r.indexOf("[]"),1),null!==this.restSlugName&&r.splice(r.indexOf("[...]"),1),null!==this.optionalRestSlugName&&r.splice(r.indexOf("[[...]]"),1);let s=r.map(r=>this.children.get(r)._smoosh(""+t+r+"/")).reduce((t,r)=>[...t,...r],[]);if(null!==this.slugName&&s.push(...this.children.get("[]")._smoosh(t+"["+this.slugName+"]/")),!this.placeholder){let r="/"===t?"/":t.slice(0,-1);if(null!=this.optionalRestSlugName)throw Object.defineProperty(Error('You cannot define a route with the same specificity as a optional catch-all route ("'+r+'" and "'+r+"[[..."+this.optionalRestSlugName+']]").'),"__NEXT_ERROR_CODE",{value:"E458",enumerable:!1});s.unshift(r)}return null!==this.restSlugName&&s.push(...this.children.get("[...]")._smoosh(t+"[..."+this.restSlugName+"]/")),null!==this.optionalRestSlugName&&s.push(...this.children.get("[[...]]")._smoosh(t+"[[..."+this.optionalRestSlugName+"]]/")),s}_insert(t,r,s){if(0===t.length){this.placeholder=!1;return}if(s)throw Object.defineProperty(Error("Catch-all must be the last part of the URL."),"__NEXT_ERROR_CODE",{value:"E392",enumerable:!1});let n=t[0];if(n.startsWith("[")&&n.endsWith("]")){let i=n.slice(1,-1),o=!1;if(i.startsWith("[")&&i.endsWith("]")&&(i=i.slice(1,-1),o=!0),i.startsWith("…"))throw Object.defineProperty(Error("Detected a three-dot character ('…') at ('"+i+"'). Did you mean ('...')?"),"__NEXT_ERROR_CODE",{value:"E147",enumerable:!1});if(i.startsWith("...")&&(i=i.substring(3),s=!0),i.startsWith("[")||i.endsWith("]"))throw Object.defineProperty(Error("Segment names may not start or end with extra brackets ('"+i+"')."),"__NEXT_ERROR_CODE",{value:"E421",enumerable:!1});if(i.startsWith("."))throw Object.defineProperty(Error("Segment names may not start with erroneous periods ('"+i+"')."),"__NEXT_ERROR_CODE",{value:"E288",enumerable:!1});function a(t,s){if(null!==t&&t!==s)throw Object.defineProperty(Error("You cannot use different slug names for the same dynamic path ('"+t+"' !== '"+s+"')."),"__NEXT_ERROR_CODE",{value:"E337",enumerable:!1});r.forEach(t=>{if(t===s)throw Object.defineProperty(Error('You cannot have the same slug name "'+s+'" repeat within a single dynamic path'),"__NEXT_ERROR_CODE",{value:"E247",enumerable:!1});if(t.replace(/\W/g,"")===n.replace(/\W/g,""))throw Object.defineProperty(Error('You cannot have the slug names "'+t+'" and "'+s+'" differ only by non-word symbols within a single dynamic path'),"__NEXT_ERROR_CODE",{value:"E499",enumerable:!1})}),r.push(s)}if(s){if(o){if(null!=this.restSlugName)throw Object.defineProperty(Error('You cannot use both an required and optional catch-all route at the same level ("[...'+this.restSlugName+']" and "'+t[0]+'" ).'),"__NEXT_ERROR_CODE",{value:"E299",enumerable:!1});a(this.optionalRestSlugName,i),this.optionalRestSlugName=i,n="[[...]]"}else{if(null!=this.optionalRestSlugName)throw Object.defineProperty(Error('You cannot use both an optional and required catch-all route at the same level ("[[...'+this.optionalRestSlugName+']]" and "'+t[0]+'").'),"__NEXT_ERROR_CODE",{value:"E300",enumerable:!1});a(this.restSlugName,i),this.restSlugName=i,n="[...]"}}else{if(o)throw Object.defineProperty(Error('Optional route parameters are not yet supported ("'+t[0]+'").'),"__NEXT_ERROR_CODE",{value:"E435",enumerable:!1});a(this.slugName,i),this.slugName=i,n="[]"}}this.children.has(n)||this.children.set(n,new sm),this.children.get(n)._insert(t.slice(1),r,s)}constructor(){this.placeholder=!0,this.children=new Map,this.slugName=null,this.restSlugName=null,this.optionalRestSlugName=null}}function sh(t){let r=new sm;return t.forEach(t=>r.insert(t)),r.smoosh()}class sy{constructor(t){this.definition=t,r0(t.pathname)&&(this.dynamic=ex(tJ(t.pathname)))}get identity(){return this.definition.pathname}get isDynamic(){return void 0!==this.dynamic}match(t){let r=this.test(t);return r?{definition:this.definition,params:r.params}:null}test(t){if(this.dynamic){let r=this.dynamic(t);return r?{params:r}:null}return t===this.definition.pathname?{}:null}}class sg extends sy{get identity(){var t;return`${this.definition.pathname}?__nextLocale=${null==(t=this.definition.i18n)?void 0:t.locale}`}match(t,r){var s,n;let a=this.test(t,r);return a?{definition:this.definition,params:a.params,detectedLocale:(null==r?void 0:null==(s=r.i18n)?void 0:s.detectedLocale)??(null==(n=this.definition.i18n)?void 0:n.locale)}:null}test(t,r){return this.definition.i18n&&(null==r?void 0:r.i18n)?this.definition.i18n.locale&&r.i18n.detectedLocale&&this.definition.i18n.locale!==r.i18n.detectedLocale?null:super.test(r.i18n.pathname):super.test(t)}}class sb{get compilationID(){return this.providers.length}async waitTillReady(){this.waitTillReadyPromise&&(await this.waitTillReadyPromise,delete this.waitTillReadyPromise)}async reload(){let{promise:t,resolve:r,reject:s}=new tZ;this.waitTillReadyPromise=t;let n=this.compilationID;try{let t=[],r=await Promise.all(this.providers.map(t=>t.matchers())),s=new Map,a={};for(let n of r)for(let r of n){r.duplicated&&delete r.duplicated;let n=s.get(r.definition.pathname);if(n){let t=a[r.definition.pathname]??[n];t.push(r),a[r.definition.pathname]=t,n.duplicated=t,r.duplicated=t}t.push(r),s.set(r.definition.pathname,r)}if(this.matchers.duplicates=a,this.previousMatchers.length===t.length&&this.previousMatchers.every((r,s)=>r===t[s]))return;this.previousMatchers=t,this.matchers.static=t.filter(t=>!t.isDynamic);let i=t.filter(t=>t.isDynamic),o=new Map,B=[];for(let t=0;t<i.length;t++){let r=i[t].definition.pathname,s=o.get(r)??[];s.push(t),1===s.length&&(o.set(r,s),B.push(r))}let l=sh(B),u=[];for(let t of l){let r=o.get(t);if(!Array.isArray(r))throw Object.defineProperty(Error("Invariant: expected to find identity in indexes map"),"__NEXT_ERROR_CODE",{value:"E271",enumerable:!1});let s=r.map(t=>i[t]);u.push(...s)}if(this.matchers.dynamic=u,this.compilationID!==n)throw Object.defineProperty(Error("Invariant: expected compilation to finish before new matchers were added, possible missing await"),"__NEXT_ERROR_CODE",{value:"E242",enumerable:!1})}catch(t){s(t)}finally{this.lastCompilationID=n,r()}}push(t){this.providers.push(t)}async test(t,r){return null!==await this.match(t,r)}async match(t,r){for await(let s of this.matchAll(t,r))return s;return null}validate(t,r,s){var n;return r instanceof sg?r.match(t,s):(null==(n=s.i18n)?void 0:n.inferredFromDefault)?r.match(s.i18n.pathname):r.match(t)}async *matchAll(t,r){if(this.lastCompilationID!==this.compilationID)throw Object.defineProperty(Error("Invariant: expected routes to have been loaded before match"),"__NEXT_ERROR_CODE",{value:"E235",enumerable:!1});if(!r0(t=t_(t)))for(let s of this.matchers.static){let n=this.validate(t,s,r);n&&(yield n)}if(null==r?void 0:r.skipDynamic)return null;for(let s of this.matchers.dynamic){let n=this.validate(t,s,r);n&&(yield n)}return null}constructor(){this.providers=[],this.matchers={static:[],dynamic:[],duplicates:{}},this.lastCompilationID=this.compilationID,this.previousMatchers=[]}}function sD(t){return t.endsWith("/page")}class sx{constructor(t=[]){this.normalizers=t}push(t){this.normalizers.push(t)}normalize(t){return this.normalizers.reduce((t,r)=>r.normalize(t),t)}}var sv=__webpack_require__("./dist/esm/shared/lib/isomorphic/path.js"),sE=/*#__PURE__*/__webpack_require__.n(sv);class sj{constructor(...t){this.prefix=sE().posix.join(...t)}normalize(t){return sE().posix.join(this.prefix,t)}}function sA(t){let r=/^\/index(\/|$)/.test(t)&&!r0(t)?"/index"+t:"/"===t?"/index":t_(t);{let{posix:t}=__webpack_require__("path"),s=t.normalize(r);if(s!==r)throw new eg("Requested and resolved page mismatch: "+r+" "+s)}return r}class sS extends sj{constructor(){super("app")}normalize(t){return super.normalize(sA(t))}}class sP extends sj{constructor(t){super(t,eH)}normalize(t){return super.normalize(t)}}let s_={icon:{filename:"icon",extensions:["ico","jpg","jpeg","png","svg"]},apple:{filename:"apple-icon",extensions:["jpg","jpeg","png"]},openGraph:{filename:"opengraph-image",extensions:["jpg","jpeg","png","gif"]},twitter:{filename:"twitter-image",extensions:["jpg","jpeg","png","gif"]}},sw=["js","jsx","ts","tsx"],sO=(t,r)=>r?`(?:\\.(${t.join("|")})|((\\[\\])?\\.(${r.join("|")})))`:`\\.(?:${t.join("|")})`;function sI(t,r,s){let n=[RegExp(`^[\\\\/]robots${s?`${sO(r.concat("txt"),null)}$`:""}`),RegExp(`^[\\\\/]manifest${s?`${sO(r.concat("webmanifest","json"),null)}$`:""}`),RegExp("^[\\\\/]favicon\\.ico$"),RegExp(`[\\\\/]sitemap${s?`${sO(["xml"],r)}$`:""}`),RegExp(`[\\\\/]${s_.icon.filename}\\d?${s?`${sO(s_.icon.extensions,r)}$`:""}`),RegExp(`[\\\\/]${s_.apple.filename}\\d?${s?`${sO(s_.apple.extensions,r)}$`:""}`),RegExp(`[\\\\/]${s_.openGraph.filename}\\d?${s?`${sO(s_.openGraph.extensions,r)}$`:""}`),RegExp(`[\\\\/]${s_.twitter.filename}\\d?${s?`${sO(s_.twitter.extensions,r)}$`:""}`)],a=r6(t);return n.some(t=>t.test(a))}function sT(t){let r=t.replace(/^\/?app\//,"").replace(/\/route$/,"");return"/"!==r[0]&&(r="/"+r),!r.endsWith("/page")&&sI(r,sw,!1)}function sN(t){return{normalize:t}}class sF{normalize(t){return t.replace(/%5F/g,"_")}}class sk extends sx{constructor(){super([sN(tO),new sF])}normalize(t){return super.normalize(t)}}class sM{constructor(t){this.filename=new sP(t),this.pathname=new sk,this.bundlePath=new sS}}class sR extends sy{get identity(){return`${this.definition.pathname}?__nextPage=${this.definition.page}`}}class sL{constructor(t){this.loader=t,this.cached=[]}async matchers(){let t=await this.loader.load();if(!t)return[];if(this.data&&this.loader.compare(this.data,t))return this.cached;this.data=t;let r=await this.transform(t);return this.cached=r,r}}class sH extends sL{constructor(t,r){super({load:async()=>r.load(t),compare:(t,r)=>t===r})}}class sG extends sH{constructor(t,r){super(eT,r),this.normalizers=new sM(t)}async transform(t){let r=Object.keys(t).filter(t=>sD(t)),s={};for(let t of r){let r=this.normalizers.pathname.normalize(t);r in s?s[r].push(t):s[r]=[t]}let n=[];for(let[r,a]of Object.entries(s)){let s=a[0],i=this.normalizers.filename.normalize(t[s]),o=this.normalizers.bundlePath.normalize(s);n.push(new sR({kind:rG.APP_PAGE,pathname:r,page:s,bundlePath:o,filename:i,appPaths:a}))}return n}}function sK(t){return t.endsWith("/route")}class sJ extends sy{}class sU extends sH{constructor(t,r){super(eT,r),this.normalizers=new sM(t)}async transform(t){let r=Object.keys(t).filter(t=>sK(t)),s=[];for(let n of r){let r=this.normalizers.filename.normalize(t[n]),a=this.normalizers.pathname.normalize(n),i=this.normalizers.bundlePath.normalize(n);s.push(new sJ({kind:rG.APP_ROUTE,pathname:a,page:n,bundlePath:i,filename:r}))}return s}}function sQ(t){return"/api"===t||!!(null==t?void 0:t.startsWith("/api/"))}class sW extends sy{}class sV extends sg{}class sq extends sx{constructor(){super([sN(sA),new sj("pages")])}normalize(t){return super.normalize(t)}}class sX extends sj{constructor(t){super(t,eH)}normalize(t){return super.normalize(t)}}class sY{constructor(t){this.filename=new sX(t),this.bundlePath=new sq}}class sz extends sH{constructor(t,r,s){super(eI,r),this.i18nProvider=s,this.normalizers=new sY(t)}async transform(t){let r=Object.keys(t).filter(t=>sQ(t)),s=[];for(let n of r)if(this.i18nProvider){let{detectedLocale:r,pathname:a}=this.i18nProvider.analyze(n);s.push(new sV({kind:rG.PAGES_API,pathname:a,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(t[n]),i18n:{locale:r}}))}else s.push(new sW({kind:rG.PAGES_API,pathname:n,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(t[n])}));return s}}class sZ extends sy{}class s$ extends sg{}class s1 extends sH{constructor(t,r,s){super(eI,r),this.i18nProvider=s,this.normalizers=new sY(t)}async transform(t){let r=Object.keys(t).filter(t=>!sQ(t)).filter(t=>{var r;let s=(null==(r=this.i18nProvider)?void 0:r.analyze(t).pathname)??t;return!eK.includes(s)}),s=[];for(let n of r)if(this.i18nProvider){let{detectedLocale:r,pathname:a}=this.i18nProvider.analyze(n);s.push(new s$({kind:rG.PAGES,pathname:a,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(t[n]),i18n:{locale:r}}))}else s.push(new sZ({kind:rG.PAGES,pathname:n,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(t[n])}));return s}}class s0{constructor(t){this.getter=t}load(t){return this.getter(t)}}class s2{constructor(t){var r;if(this.config=t,!t.locales.length)throw Object.defineProperty(Error("Invariant: No locales provided"),"__NEXT_ERROR_CODE",{value:"E510",enumerable:!1});this.lowerCaseLocales=t.locales.map(t=>t.toLowerCase()),this.lowerCaseDomains=null==(r=t.domains)?void 0:r.map(t=>{var r;let s=t.domain.toLowerCase();return{defaultLocale:t.defaultLocale.toLowerCase(),hostname:s.split(":",1)[0],domain:s,locales:null==(r=t.locales)?void 0:r.map(t=>t.toLowerCase()),http:t.http}})}detectDomainLocale(t,r){if(t&&this.lowerCaseDomains&&this.config.domains){r&&(r=r.toLowerCase());for(let n=0;n<this.lowerCaseDomains.length;n++){var s;let a=this.lowerCaseDomains[n];if(a.hostname===t||(null==(s=a.locales)?void 0:s.some(t=>t===r)))return this.config.domains[n]}}}fromQuery(t,r){let s=r.__nextLocale;if(s){let r=this.analyze(t);if(r.detectedLocale){if(r.detectedLocale!==s)throw Object.defineProperty(Error(`Invariant: The detected locale does not match the locale in the query. Expected to find '${s}' in '${t}' but found '${r.detectedLocale}'}`),"__NEXT_ERROR_CODE",{value:"E517",enumerable:!1});t=r.pathname}}return{pathname:t,detectedLocale:s,inferredFromDefault:"1"===r.__nextInferredLocaleFromDefault}}validate(t){return this.lowerCaseLocales.includes(t.toLowerCase())}validateQuery(t){return(!t.__nextLocale||!!this.validate(t.__nextLocale))&&(!t.__nextDefaultLocale||!!this.validate(t.__nextDefaultLocale))}analyze(t,r={}){let s=r.defaultLocale,n="string"==typeof s,a=t.split("/",2);if(!a[1])return{detectedLocale:s,pathname:t,inferredFromDefault:n};let i=a[1].toLowerCase(),o=this.lowerCaseLocales.indexOf(i);return o<0||(s=this.config.locales[o],n=!1,t=t.slice(s.length+1)||"/"),{detectedLocale:s,pathname:t,inferredFromDefault:n}}}async function s3(t,r,s,n){if(rS(r)){var a;r.statusCode=s.status,r.statusMessage=s.statusText;let i=["set-cookie","www-authenticate","proxy-authenticate"];null==(a=s.headers)||a.forEach((t,s)=>{if("set-cookie"===s.toLowerCase())for(let n of rt(t))r.appendHeader(s,n);else{let n=void 0!==r.getHeader(s);(i.includes(s.toLowerCase())||!n)&&r.appendHeader(s,t)}});let{originalResponse:o}=r;s.body&&"HEAD"!==t.method?await rL(s.body,o,n):o.end()}}let s5=r8("/_next/data/:path*");function s4(t){return"string"==typeof t&&s5(t)}function s6(t,r){return void 0===r&&(r=""),t=t.replace(/\\/g,"/"),(t=r&&t.endsWith(r)?t.slice(0,-r.length):t).startsWith("/index/")&&!r0(t)?t=t.slice(6):"/index"===t&&(t="/"),t}function s7(t,r){return t.replace(RegExp("([/#?]"+(r?"|%(2f|23|3f|5c)":"")+")","gi"),t=>encodeURIComponent(t))}function s9(t){return t.split("/").map(t=>{try{t=s7(decodeURIComponent(t),!0)}catch(t){throw Object.defineProperty(new ey("Failed to decode path param(s)."),"__NEXT_ERROR_CODE",{value:"E539",enumerable:!1})}return t}).join("/")}class s8{constructor(t){this.suffix=t}match(t){return!!t.endsWith(this.suffix)}normalize(t,r){return r||this.match(t)?t.substring(0,t.length-this.suffix.length):t}}class ne extends s8{constructor(){super(e7.RM)}}function nt(t){for(let r of ti)delete t[r.toLowerCase()]}function nr(t){return t.definition.kind===rG.APP_ROUTE}function ns(t){return t.definition.kind===rG.APP_PAGE}function nn(t){return t.definition.kind===rG.PAGES}class na extends s8{constructor(){super(e7.pu)}match(t){return t==="/__index"+e7.pu||super.match(t)}normalize(t,r){return t==="/__index"+e7.pu?"/":super.normalize(t,r)}}class ni{constructor(t){if(this.prefix=t,t.endsWith("/"))throw Object.defineProperty(Error(`PrefixPathnameNormalizer: prefix "${t}" should not end with a slash`),"__NEXT_ERROR_CODE",{value:"E219",enumerable:!1})}match(t){return!!(t===this.prefix||t.startsWith(this.prefix+"/"))}normalize(t,r){return r||this.match(t)?t.length===this.prefix.length?"/":t.substring(this.prefix.length):t}}class no{constructor(t){if(this.suffix=new s8(".json"),!t)throw Object.defineProperty(Error("Invariant: buildID is required"),"__NEXT_ERROR_CODE",{value:"E200",enumerable:!1});this.prefix=new ni(`/_next/data/${t}`)}match(t){return this.prefix.match(t)&&this.suffix.match(t)}normalize(t,r){return r||this.match(t)?(t=this.prefix.normalize(t,!0),r7(t=this.suffix.normalize(t,!0))):t}}function nB(t){let r,s;t.headers instanceof Headers?(r=t.headers.get(te.toLowerCase())??null,s=t.headers.get("content-type")):(r=t.headers[te.toLowerCase()]??null,s=t.headers["content-type"]??null);let n=!!("POST"===t.method&&"application/x-www-form-urlencoded"===s),a=!!("POST"===t.method&&(null==s?void 0:s.startsWith("multipart/form-data"))),i=!!(void 0!==r&&"string"==typeof r&&"POST"===t.method),o=!!(i||n||a);return{actionId:r,isURLEncodedAction:n,isMultipartAction:a,isFetchAction:i,isServerAction:o}}function nl(t){return nB(t).isServerAction}function nu(t){return t.replace(/(?:\/index)?\/?$/,"")||"/"}function nc(t,r){let s=r.setHeader.bind(r);r.setHeader=(n,a)=>{if("headersSent"in r&&r.headersSent)return r;if("set-cookie"===n.toLowerCase()){let r=eE(t,"middlewareCookie");r&&Array.isArray(a)&&a.every((t,s)=>t===r[s])||(a=[...new Set([...r||[],..."string"==typeof a?[a]:Array.isArray(a)?a:[]])])}return s(n,a)}}function nd(t){return void 0!==t&&("boolean"==typeof t?t:"incremental"===t)}let np=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1});class nC{disable(){throw np}getStore(){}run(){throw np}exit(){throw np}enterWith(){throw np}static bind(t){return t}}let nf="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function nm(){return nf?new nf:new nC}function nh(){let t=globalThis[ny];return null==t?void 0:t.get()}let ny=Symbol.for("@next/request-context");Symbol("response"),Symbol("passThrough"),Symbol("waitUntil");var ng=__webpack_require__("./dist/esm/server/web/spec-extension/adapters/reflect.js");let nb=Symbol("internal response"),nD=new Set([301,302,303,307,308]);function nx(t,r){var s;if(null==t?void 0:null==(s=t.request)?void 0:s.headers){if(!(t.request.headers instanceof Headers))throw Object.defineProperty(Error("request.headers must be an instance of Headers"),"__NEXT_ERROR_CODE",{value:"E119",enumerable:!1});let s=[];for(let[n,a]of t.request.headers)r.set("x-middleware-request-"+n,a),s.push(n);r.set("x-middleware-override-headers",s.join(","))}}class nv extends Response{constructor(t,r={}){super(t,r);let s=this.headers,n=new Proxy(new rv.VO(s),{get(t,n,a){switch(n){case"delete":case"set":return(...a)=>{let i=Reflect.apply(t[n],t,a),o=new Headers(s);return i instanceof rv.VO&&s.set("x-middleware-set-cookie",i.getAll().map(t=>(0,rv.Ud)(t)).join(",")),nx(r,o),i};default:return ng.l.get(t,n,a)}}});this[nb]={cookies:n,url:r.url?new rg(r.url,{headers:rr(s),nextConfig:r.nextConfig}):void 0}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,url:this.url,body:this.body,bodyUsed:this.bodyUsed,headers:Object.fromEntries(this.headers),ok:this.ok,redirected:this.redirected,status:this.status,statusText:this.statusText,type:this.type}}get cookies(){return this[nb].cookies}static json(t,r){let s=Response.json(t,r);return new nv(s.body,s)}static redirect(t,r){let s="number"==typeof r?r:(null==r?void 0:r.status)??307;if(!nD.has(s))throw Object.defineProperty(RangeError('Failed to execute "redirect" on "response": Invalid status code'),"__NEXT_ERROR_CODE",{value:"E529",enumerable:!1});let n="object"==typeof r?r:{},a=new Headers(null==n?void 0:n.headers);return a.set("Location",rs(t)),new nv(null,{...n,headers:a,status:s})}static rewrite(t,r){let s=new Headers(null==r?void 0:r.headers);return s.set("x-middleware-rewrite",rs(t)),nx(r,s),new nv(null,{...r,headers:s})}static next(t){let r=new Headers(null==t?void 0:t.headers);return r.set("x-middleware-next","1"),nx(t,r),new nv(null,{...t,headers:r})}}async function nE(){return"_ENTRIES"in globalThis&&_ENTRIES.middleware_instrumentation&&await _ENTRIES.middleware_instrumentation}let nj=null;async function nA(){if("phase-production-build"===process.env.NEXT_PHASE)return;nj||(nj=nE());let t=await nj;if(null==t?void 0:t.register)try{await t.register()}catch(t){throw t.message=`An error occurred while loading instrumentation hook: ${t.message}`,t}}let nS=null;function nP(){return nS||(nS=nA()),nS}function n_(t){return`The edge runtime does not support Node.js '${t}' module.
|
|
2870
2870
|
Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime`}function nw(t){let r=new Proxy(function(){},{get(r,s){if("then"===s)return{};throw Object.defineProperty(Error(n_(t)),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1})},construct(){throw Object.defineProperty(Error(n_(t)),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1})},apply(s,n,a){if("function"==typeof a[0])return a[0](r);throw Object.defineProperty(Error(n_(t)),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1})}});return new Proxy({},{get:()=>r})}(function(){process!==global.process&&(process.env=global.process.env,global.process=process),Object.defineProperty(globalThis,"__import_unsupported",{value:nw,enumerable:!1,configurable:!1}),nP()})(),__webpack_require__("./dist/esm/server/web/spec-extension/adapters/headers.js");class nO extends Error{constructor(){super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options")}static callable(){throw new nO}}Symbol.for("next.mutated.cookies"),__webpack_require__("./dist/compiled/p-queue/index.js"),require("next/dist/server/app-render/after-task-async-storage.external.js");class nI extends rj{constructor(t){super(t.input,t.init),this.sourcePage=t.page}get request(){throw Object.defineProperty(new rb({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1})}respondWith(){throw Object.defineProperty(new rb({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1})}waitUntil(){throw Object.defineProperty(new rb({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1})}}function nT(t){return t.isOnDemandRevalidate?"on-demand":t.isRevalidate?"stale":void 0}var nN=/*#__PURE__*/function(t){return t.BLOCKING_STATIC_RENDER="BLOCKING_STATIC_RENDER",t.PRERENDER="PRERENDER",t.NOT_FOUND="NOT_FOUND",t}({});function nF(t){if("string"==typeof t)return"PRERENDER";if(null===t)return"BLOCKING_STATIC_RENDER";if(!1===t)return"NOT_FOUND";if(void 0!==t)throw Object.defineProperty(Error(`Invalid fallback option: ${t}. Fallback option must be a string, null, undefined, or false.`),"__NEXT_ERROR_CODE",{value:"E285",enumerable:!1})}class nk extends Error{}class nM extends Error{constructor(t){super(),this.innerError=t}}class nR{getServerComponentsHmrCache(){return this.nextConfig.experimental.serverComponentsHmrCache?globalThis.__serverComponentsHmrCache:void 0}constructor(t){var r,s,n;this.handleRSCRequest=(t,r,s)=>{var n,a;if(!s.pathname)return!1;if(null==(n=this.normalizers.prefetchRSC)?void 0:n.match(s.pathname))s.pathname=this.normalizers.prefetchRSC.normalize(s.pathname,!0),t.headers[e8.toLowerCase()]="1",t.headers[tr.toLowerCase()]="1",eA(t,"isRSCRequest",!0),eA(t,"isPrefetchRSCRequest",!0);else if(null==(a=this.normalizers.rsc)?void 0:a.match(s.pathname))s.pathname=this.normalizers.rsc.normalize(s.pathname,!0),t.headers[e8.toLowerCase()]="1",eA(t,"isRSCRequest",!0);else{if(t.headers["x-now-route-matches"])return nt(t.headers),!1;if("1"!==t.headers[e8.toLowerCase()])return!1;eA(t,"isRSCRequest",!0),"1"===t.headers[tr.toLowerCase()]&&eA(t,"isPrefetchRSCRequest",!0)}if(t.url){let r=(0,d.parse)(t.url);r.pathname=s.pathname,t.url=(0,d.format)(r)}return!1},this.handleNextDataRequest=async(t,r,s)=>{let n=this.getMiddleware(),a=s4(s.pathname);if(!a||!a.path)return!1;if(a.path[0]!==this.buildId)return!eE(t,"middlewareInvoke")&&(await this.render404(t,r,s),!0);a.path.shift();let i=a.path[a.path.length-1];if("string"!=typeof i||!i.endsWith(".json"))return await this.render404(t,r,s),!0;let o=`/${a.path.join("/")}`;if(o=s6(o,".json"),n&&(this.nextConfig.trailingSlash&&!o.endsWith("/")&&(o+="/"),!this.nextConfig.trailingSlash&&o.length>1&&o.endsWith("/")&&(o=o.substring(0,o.length-1))),this.i18nProvider){var B;let a=null==t?void 0:null==(B=t.headers.host)?void 0:B.split(":",1)[0].toLowerCase(),i=this.i18nProvider.detectDomainLocale(a),l=(null==i?void 0:i.defaultLocale)??this.i18nProvider.config.defaultLocale,u=this.i18nProvider.analyze(o);if(u.detectedLocale&&(o=u.pathname),s.query.__nextLocale=u.detectedLocale,s.query.__nextDefaultLocale=l,u.detectedLocale||delete s.query.__nextInferredLocaleFromDefault,!u.detectedLocale&&!n)return s.query.__nextLocale=l,await this.render404(t,r,s),!0}return s.pathname=o,s.query.__nextDataReq="1",!1},this.handleNextImageRequest=()=>!1,this.handleCatchallRenderRequest=()=>!1,this.handleCatchallMiddlewareRequest=()=>!1,this.normalize=t=>{let r=[];for(let s of(this.normalizers.data&&r.push(this.normalizers.data),this.normalizers.prefetchRSC&&r.push(this.normalizers.prefetchRSC),this.normalizers.rsc&&r.push(this.normalizers.rsc),r))if(s.match(t))return s.normalize(t,!0);return t},this.normalizeAndAttachMetadata=async(t,r,s)=>{let n=await this.handleNextImageRequest(t,r,s);return!!(n||this.enabledDirectories.pages&&(n=await this.handleNextDataRequest(t,r,s)))},this.prepared=!1,this.preparedPromise=null,this.customErrorNo404Warn=ef(()=>{tx(`You have added a custom /_error page without a custom /404 page. This prevents the 404 page from being auto statically optimized.
|
|
2871
2871
|
See here for info: https://nextjs.org/docs/messages/custom-error-no-custom-404`)});let{dir:a=".",quiet:i=!1,conf:o,dev:B=!1,minimalMode:l=!1,customServer:u=!0,hostname:c,port:p,experimentalTestProxy:C}=t;this.experimentalTestProxy=C,this.serverOptions=t,this.dir=__webpack_require__("path").resolve(a),this.quiet=i,this.loadEnvConfig({dev:B}),this.nextConfig=o,this.hostname=c,this.hostname&&(this.fetchHostname=rz(this.hostname)),this.port=p,this.distDir=__webpack_require__("path").join(this.dir,this.nextConfig.distDir),this.publicDir=this.getPublicDir(),this.hasStaticDir=!l&&this.getHasStaticDir(),this.i18nProvider=(null==(r=this.nextConfig.i18n)?void 0:r.locales)?new s2(this.nextConfig.i18n):void 0,this.localeNormalizer=this.i18nProvider?new sf(this.i18nProvider):void 0;let{serverRuntimeConfig:f={},publicRuntimeConfig:m,assetPrefix:h,generateEtags:y}=this.nextConfig;this.buildId=this.getBuildId(),this.minimalMode=l||!!process.env.NEXT_PRIVATE_MINIMAL_MODE,this.enabledDirectories=this.getEnabledDirectories(B),this.isAppPPREnabled=this.enabledDirectories.app&&nd(this.nextConfig.experimental.ppr),this.normalizers={rsc:this.enabledDirectories.app?new ne:void 0,prefetchRSC:this.isAppPPREnabled?new na:void 0,data:this.enabledDirectories.pages?new no(this.buildId):void 0},this.nextFontManifest=this.getNextFontManifest(),process.env.NEXT_DEPLOYMENT_ID=this.nextConfig.deploymentId||"",this.renderOpts={supportsDynamicResponse:!0,trailingSlash:this.nextConfig.trailingSlash,deploymentId:this.nextConfig.deploymentId,strictNextHead:this.nextConfig.experimental.strictNextHead??!0,poweredByHeader:this.nextConfig.poweredByHeader,canonicalBase:this.nextConfig.amp.canonicalBase||"",buildId:this.buildId,generateEtags:y,previewProps:this.getPrerenderManifest().preview,customServer:!0===u||void 0,ampOptimizerConfig:null==(s=this.nextConfig.experimental.amp)?void 0:s.optimizer,basePath:this.nextConfig.basePath,images:this.nextConfig.images,optimizeCss:this.nextConfig.experimental.optimizeCss,nextConfigOutput:this.nextConfig.output,nextScriptWorkers:this.nextConfig.experimental.nextScriptWorkers,disableOptimizedLoading:this.nextConfig.experimental.disableOptimizedLoading,domainLocales:null==(n=this.nextConfig.i18n)?void 0:n.domains,distDir:this.distDir,serverComponents:this.enabledDirectories.app,cacheLifeProfiles:this.nextConfig.experimental.cacheLife,enableTainting:this.nextConfig.experimental.taint,crossOrigin:this.nextConfig.crossOrigin?this.nextConfig.crossOrigin:void 0,largePageDataBytes:this.nextConfig.experimental.largePageDataBytes,runtimeConfig:Object.keys(m).length>0?m:void 0,isExperimentalCompile:this.nextConfig.experimental.isExperimentalCompile,experimental:{expireTime:this.nextConfig.expireTime,clientTraceMetadata:this.nextConfig.experimental.clientTraceMetadata,dynamicIO:this.nextConfig.experimental.dynamicIO??!1,inlineCss:this.nextConfig.experimental.inlineCss??!1,authInterrupts:!!this.nextConfig.experimental.authInterrupts},onInstrumentationRequestError:this.instrumentationOnRequestError.bind(this),reactMaxHeadersLength:this.nextConfig.reactMaxHeadersLength},(0,r2.setConfig)({serverRuntimeConfig:f,publicRuntimeConfig:m}),this.pagesManifest=this.getPagesManifest(),this.appPathsManifest=this.getAppPathsManifest(),this.appPathRoutes=this.getAppPathRoutes(),this.interceptionRoutePatterns=this.getinterceptionRoutePatterns(),this.matchers=this.getRouteMatchers(),this.matchers.reload(),this.setAssetPrefix(h),this.responseCache=this.getResponseCache({dev:B})}reloadMatchers(){return this.matchers.reload()}getRouteMatchers(){let t=new s0(t=>{switch(t){case eI:return this.getPagesManifest()??null;case eT:return this.getAppPathsManifest()??null;default:return null}}),r=new sb;return r.push(new s1(this.distDir,t,this.i18nProvider)),r.push(new sz(this.distDir,t,this.i18nProvider)),this.enabledDirectories.app&&(r.push(new sG(this.distDir,t)),r.push(new sU(this.distDir,t))),r}async instrumentationOnRequestError(...t){let[r,s,n]=t;if(this.instrumentation)try{await (null==this.instrumentation.onRequestError?void 0:this.instrumentation.onRequestError.call(this.instrumentation,r,{path:s.url||"",method:s.method||"GET",headers:s instanceof nI?Object.fromEntries(s.headers.entries()):s.headers},n))}catch(t){console.error("Error in instrumentation.onRequestError:",t)}}logError(t){this.quiet||tD(t)}async handleRequest(t,r,s){await this.prepare();let n=t.method.toUpperCase(),a=(0,t0.getTracer)();return a.withPropagatedContext(t.headers,()=>a.trace(t2.Li.handleRequest,{spanName:`${n} ${t.url}`,kind:t0.SpanKind.SERVER,attributes:{"http.method":n,"http.target":t.url}},async i=>this.handleRequestImpl(t,r,s).finally(()=>{if(!i)return;let s=eE(t,"isRSCRequest")??!1;i.setAttributes({"http.status_code":r.statusCode,"next.rsc":s});let o=a.getRootSpanAttributes();if(!o)return;if(o.get("next.span_type")!==t2.Li.handleRequest){console.warn(`Unexpected root span type '${o.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);return}let B=o.get("next.route");if(B){let t=s?`RSC ${n} ${B}`:`${n} ${B}`;i.setAttributes({"next.route":B,"http.route":B,"next.span_name":t}),i.updateName(t)}else i.updateName(s?`RSC ${n} ${t.url}`:`${n} ${t.url}`)})))}async handleRequestImpl(t,r,s){try{var n,a,i,o,B,l,u,c,p,C,f;await this.matchers.waitTillReady(),nc(t,rS(r)?r.originalResponse:r);let m=(t.url||"").split("?",1)[0];if(null==m?void 0:m.match(/(\\|\/\/)/)){let s=eh(t.url);r.redirect(s,308).body(s).send();return}if(!s||"object"!=typeof s){if(!t.url)throw Object.defineProperty(Error("Invariant: url can not be undefined"),"__NEXT_ERROR_CODE",{value:"E123",enumerable:!1});s=(0,d.parse)(t.url,!0)}if(!s.pathname)throw Object.defineProperty(Error("Invariant: pathname can't be empty"),"__NEXT_ERROR_CODE",{value:"E412",enumerable:!1});"string"==typeof s.query&&(s.query=Object.fromEntries(new URLSearchParams(s.query)));let{originalRequest:h=null}=rA(t)?t:{},y=null==h?void 0:h.headers["x-forwarded-proto"],g=y?"https"===y:!!(null==h?void 0:null==(n=h.socket)?void 0:n.encrypted);t.headers["x-forwarded-host"]??=t.headers.host??this.hostname,t.headers["x-forwarded-port"]??=this.port?this.port.toString():g?"443":"80",t.headers["x-forwarded-proto"]??=g?"https":"http",t.headers["x-forwarded-for"]??=null==h?void 0:null==(a=h.socket)?void 0:a.remoteAddress,(null==(i=this.i18nProvider)?void 0:i.validateQuery(s.query))||(delete s.query.__nextLocale,delete s.query.__nextDefaultLocale,delete s.query.__nextInferredLocaleFromDefault),this.attachRequestMeta(t,s);let b=await this.handleRSCRequest(t,r,s);if(b)return;let D=null==(o=this.i18nProvider)?void 0:o.detectDomainLocale(rd(s,t.headers)),x=(null==D?void 0:D.defaultLocale)||(null==(B=this.nextConfig.i18n)?void 0:B.defaultLocale);s.query.__nextDefaultLocale=x;let v=tC(t.url.replace(/^\/+/,"/")),E=rf(v.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});v.pathname=E.pathname,E.basePath&&(t.url=rC(t.url,this.nextConfig.basePath));let j="string"==typeof t.headers[e7.vx];if(j)try{this.enabledDirectories.app&&(t.url.match(/^\/index($|\?)/)&&(t.url=t.url.replace(/^\/index/,"/")),s.pathname="/index"===s.pathname?"/":s.pathname);let{pathname:n}=new URL(t.headers[e7.vx],"http://localhost"),{pathname:a}=new URL(t.url,"http://localhost");if(null==(l=this.normalizers.data)?void 0:l.match(a))s.query.__nextDataReq="1";else if(this.isAppPPREnabled&&"1"===t.headers[e7.gs]&&"POST"===t.method){let r=[];for await(let s of t.body)r.push(s);let s=Buffer.concat(r).toString("utf8");eA(t,"postponed",s)}n=this.normalize(n);let i=this.stripNextDataPath(a),o=null==(u=this.i18nProvider)?void 0:u.analyze(n,{defaultLocale:x});o&&(s.query.__nextLocale=o.detectedLocale,o.inferredFromDefault?s.query.__nextInferredLocaleFromDefault="1":delete s.query.__nextInferredLocaleFromDefault);let B=n=r7(n),d=r0(B);if(!d){let t=await this.matchers.match(B,{i18n:o});t&&(B=t.definition.pathname,d=void 0!==t.params)}o&&(n=o.pathname);let C=sl({pageIsDynamic:d,page:B,i18n:this.nextConfig.i18n,basePath:this.nextConfig.basePath,rewrites:(null==(c=this.getRoutesManifest())?void 0:c.rewrites)||{beforeFiles:[],afterFiles:[],fallback:[]},caseSensitive:!!this.nextConfig.experimental.caseSensitiveRoutes});x&&!E.locale&&(s.pathname=`/${x}${s.pathname}`);let f=s.pathname,m=C.handleRewrites(t,s),h=Object.keys(m),y=f!==s.pathname;y&&s.pathname&&eA(t,"rewroteURL",s.pathname);let g=new Set;for(let t of Object.keys(s.query)){let r=s.query[t];rn(t,n=>{s&&(s.query[n]=r,g.add(n),delete s.query[t])})}if(d){let r={},a=C.normalizeDynamicRouteParams(s.query);if(!a.hasValidParams&&!r0(i)){let t=null==C.dynamicRouteMatcher?void 0:C.dynamicRouteMatcher.call(C,i);t&&(C.normalizeDynamicRouteParams(t),Object.assign(a.params,t),a.hasValidParams=!0)}if("/index"!==n&&!a.hasValidParams&&!r0(n)){let t=null==C.dynamicRouteMatcher?void 0:C.dynamicRouteMatcher.call(C,n);if(t){let s=C.normalizeDynamicRouteParams(t);s.hasValidParams&&(Object.assign(r,t),a=s)}}if(a.hasValidParams&&(r=a.params),t.headers["x-now-route-matches"]&&r0(n)&&!a.hasValidParams){let n={},i=C.getParamsFromRouteMatches(t,n,s.query.__nextLocale||"");n.locale&&(s.query.__nextLocale=n.locale,delete s.query.__nextInferredLocaleFromDefault),(a=C.normalizeDynamicRouteParams(i,!0)).hasValidParams&&(r=a.params)}!C.defaultRouteMatches||i!==B||a.hasValidParams||C.normalizeDynamicRouteParams({...r},!0).hasValidParams||(r=C.defaultRouteMatches,eA(t,"didSetDefaultRouteMatches",!0)),r&&(n=C.interpolateDynamicPath(B,r),t.url=C.interpolateDynamicPath(t.url,r))}for(let r of((d||y)&&C.normalizeVercelUrl(t,!0,[...h,...Object.keys((null==(p=C.defaultRouteRegex)?void 0:p.groups)||{})]),g))delete s.query[r];if(s.pathname=n,v.pathname=s.pathname,b=await this.normalizeAndAttachMetadata(t,r,s))return}catch(s){if(s instanceof ey||s instanceof eg)return r.statusCode=400,this.renderError(null,t,r,"/_error",{});throw s}if(eA(t,"isLocaleDomain",!!D),E.locale&&(t.url=(0,d.format)(v),eA(t,"didStripLocale",!0)),!s.query.__nextLocale&&(E.locale?s.query.__nextLocale=E.locale:x&&(s.query.__nextLocale=x,s.query.__nextInferredLocaleFromDefault="1")),!this.serverOptions.webServerConfig&&!eE(t,"incrementalCache")){let r="https:";try{r=new URL(eE(t,"initURL")||"/","http://n").protocol}catch{}let s=await this.getIncrementalCache({requestHeaders:Object.assign({},t.headers),requestProtocol:r.substring(0,r.length-1)});s.resetRequestCache(),eA(t,"incrementalCache",s),globalThis.__incrementalCache=s}let A=globalThis;if(A.__nextCacheHandlers){let r=(null==(C=t.headers[e7.vS])?void 0:C.split(","))||[];for(let t of Object.values(A.__nextCacheHandlers))"function"==typeof t.receiveExpiredTags&&await t.receiveExpiredTags(...r)}eE(t,"serverComponentsHmrCache")||eA(t,"serverComponentsHmrCache",this.getServerComponentsHmrCache());let S=eE(t,"invokePath");if(!j&&S){let n=eE(t,"invokeStatus");if(n){let a=eE(t,"invokeQuery");a&&Object.assign(s.query,a),r.statusCode=n;let i=eE(t,"invokeError")||null;return this.renderError(i,t,r,"/_error",s.query)}let a=new URL(S||"/","http://n"),i=rf(a.pathname,{nextConfig:this.nextConfig,parseData:!1});i.locale&&(s.query.__nextLocale=i.locale),s.pathname!==a.pathname&&(s.pathname=a.pathname,eA(t,"rewroteURL",i.pathname));let o=rp(rC(s.pathname,this.nextConfig.basePath||""),(null==(f=this.nextConfig.i18n)?void 0:f.locales)||[]);for(let t of(o.detectedLocale&&(s.query.__nextLocale=o.detectedLocale),s.pathname=o.pathname,Object.keys(s.query)))t.startsWith("__next")||t.startsWith("_next")||delete s.query[t];let B=eE(t,"invokeQuery");if(B&&Object.assign(s.query,B),b=await this.normalizeAndAttachMetadata(t,r,s))return;await this.handleCatchallRenderRequest(t,r,s);return}if(eE(t,"middlewareInvoke")){if((b=await this.normalizeAndAttachMetadata(t,r,s))||(b=await this.handleCatchallMiddlewareRequest(t,r,s)))return;let n=Error();throw n.result={response:new Response(null,{headers:{"x-middleware-next":"1"}})},n.bubble=!0,n}return!j&&E.basePath&&(s.pathname=rC(s.pathname,E.basePath)),r.statusCode=200,await this.run(t,r,s)}catch(s){if(s instanceof nk)throw s;if(s&&"object"==typeof s&&"ERR_INVALID_URL"===s.code||s instanceof ey||s instanceof eg)return r.statusCode=400,this.renderError(null,t,r,"/_error",{});throw s}}getRequestHandlerWithMetadata(t){let r=this.getRequestHandler();return(s,n,a)=>(ej(s,t),r(s,n,a))}getRequestHandler(){return this.handleRequest.bind(this)}setAssetPrefix(t){this.renderOpts.assetPrefix=t?t.replace(/\/$/,""):""}async prepare(){if(!this.prepared)return null===this.preparedPromise&&(this.instrumentation=await this.loadInstrumentationModule(),this.preparedPromise=this.prepareImpl().then(()=>{this.prepared=!0,this.preparedPromise=null})),this.preparedPromise}async prepareImpl(){}async loadInstrumentationModule(){}async close(){}getAppPathRoutes(){let t={};return Object.keys(this.appPathsManifest||{}).forEach(r=>{let s=tO(r);t[s]||(t[s]=[]),t[s].push(r)}),t}async run(t,r,s){return(0,t0.getTracer)().trace(t2.Li.run,async()=>this.runImpl(t,r,s))}async runImpl(t,r,s){await this.handleCatchallRenderRequest(t,r,s)}async pipe(t,r){return(0,t0.getTracer)().trace(t2.Li.pipe,async()=>this.pipeImpl(t,r))}async pipeImpl(t,r){let s=r4(r.req.headers["user-agent"]||""),n={...r,renderOpts:{...this.renderOpts,supportsDynamicResponse:!s,isBot:!!s}},a=await t(n);if(null===a)return;let{req:i,res:o}=n,B=o.statusCode,{body:l,type:u}=a,{revalidate:c}=a;if(!o.sent){let{generateEtags:t,poweredByHeader:r,dev:s}=this.renderOpts;s&&(o.setHeader("Cache-Control","no-store, must-revalidate"),c=void 0),await this.sendRenderResult(i,o,{result:l,type:u,generateEtags:t,poweredByHeader:r,revalidate:c,expireTime:this.nextConfig.expireTime}),o.statusCode=B}}async getStaticHTML(t,r){let s={...r,renderOpts:{...this.renderOpts,supportsDynamicResponse:!1}},n=await t(s);return null===n?null:n.body.toUnchunkedString()}async render(t,r,s,n={},a,i=!1){return(0,t0.getTracer)().trace(t2.Li.render,async()=>this.renderImpl(t,r,s,n,a,i))}getWaitUntil(){let t=nh();if(t)return t.waitUntil}getInternalWaitUntil(){}async renderImpl(t,r,s,n={},a,i=!1){return(s.startsWith("/")||console.warn(`Cannot render page with path "${s}", did you mean "/${s}"?. See more info here: https://nextjs.org/docs/messages/render-no-starting-slash`),this.renderOpts.customServer&&"/index"===s&&!await this.hasPage("/index")&&(s="/"),r3(s))?this.render404(t,r,a):this.pipe(t=>this.renderToResponse(t),{req:t,res:r,pathname:s,query:n})}async getStaticPaths({pathname:t}){var r;return{staticPaths:void 0,fallbackMode:nF(null==(r=this.getPrerenderManifest().dynamicRoutes[t])?void 0:r.fallback)}}async renderToResponseWithComponents(t,r){return(0,t0.getTracer)().trace(t2.Li.renderToResponseWithComponents,async()=>this.renderToResponseWithComponentsImpl(t,r))}pathCouldBeIntercepted(t){return tN(t)||this.interceptionRoutePatterns.some(r=>r.test(t))}setVaryHeader(t,r,s,n){let a=`${e8}, ${tt}, ${tr}, ${ts}`,i=eE(t,"isRSCRequest")??!1,o=!1;s&&this.pathCouldBeIntercepted(n)?(r.setHeader("vary",`${a}, ${tn}`),o=!0):(s||i)&&r.setHeader("vary",a),o||delete t.headers[tn]}async renderToResponseWithComponentsImpl({req:t,res:r,pathname:s,renderOpts:n},{components:a,query:i}){var o,B,l,u,c,p,C,f,m,h;let y,g,b,D;s===e_&&(s="/404");let x="/_error"===s,v="/404"===s||x&&404===r.statusCode,E="/500"===s||x&&500===r.statusCode,j=!0===a.isAppPath,A=!!a.getServerSideProps,S=!!a.getStaticPaths,P=nl(t),_=!!(null==(o=a.Component)?void 0:o.getInitialProps),w=!!a.getStaticProps,O=(0,d.parse)(t.url||"").pathname||"/",I=eE(t,"rewroteURL")||O;this.setVaryHeader(t,r,j,I);let T=!1,N=r0(a.page),F=this.getPrerenderManifest();if(j&&N){let r=await this.getStaticPaths({pathname:s,page:a.page,isAppPath:j,requestHeaders:t.headers});if(y=r.staticPaths,T=void 0!==(g=r.fallbackMode),"export"===this.nextConfig.output){let t=a.page;if(!y)throw Object.defineProperty(Error(`Page "${t}" is missing exported function "generateStaticParams()", which is required with "output: export" config.`),"__NEXT_ERROR_CODE",{value:"E353",enumerable:!1});let r=tL(I);if(!y.includes(r))throw Object.defineProperty(Error(`Page "${t}" is missing param "${r}" in "generateStaticParams()", which is required with "output: export" config.`),"__NEXT_ERROR_CODE",{value:"E443",enumerable:!1})}T&&(S=!0)}T||(null==y?void 0:y.includes(I))||t.headers["x-now-route-matches"]?w=!0:w||=!!F.routes[nu(s)];let k=!!(i.__nextDataReq||t.headers["x-nextjs-data"]&&this.serverOptions.webServerConfig)&&(w||A),M=eE(t,"isPrefetchRSCRequest")??!1,R=eE(t,"isRSCRequest")??!1;if(!w&&t.headers["x-middleware-prefetch"]&&!(v||"/_error"===s))return r.setHeader(e7.vx,s),r.setHeader("x-middleware-skip","1"),r.setHeader("cache-control","private, no-cache, no-store, max-age=0, must-revalidate"),r.body("{}").send(),null;delete i.__nextDataReq,w&&t.headers[e7.vx]&&t.url.startsWith("/_next/data")&&(t.url=this.stripNextDataPath(t.url)),t.headers["x-nextjs-data"]&&(!r.statusCode||200===r.statusCode)&&r.setHeader("x-nextjs-matched-path",`${i.__nextLocale?`/${i.__nextLocale}`:""}${s}`),a.routeModule&&(b=a.routeModule);let L=this.isAppPPREnabled&&void 0!==b&&ns(b),H="1"===process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING&&void 0!==i.__nextppronly&&L,G=H&&"fallback"===i.__nextppronly,K=L&&((null==(B=F.routes[s]??F.dynamicRoutes[s])?void 0:B.renderingMode)==="PARTIALLY_STATIC"||H&&!0===this.experimentalTestProxy),J=H&&K,U=J&&!1,Q=G&&K,W=K?eE(t,"postponed"):void 0,V=K&&R&&!M,q=t.headers[ts.toLowerCase()];if(!v||k||R||(r.statusCode=404),eq.includes(s)&&(r.statusCode=parseInt(s.slice(1),10)),!P&&!W&&!v&&!E&&"/_error"!==s&&"HEAD"!==t.method&&"GET"!==t.method&&("string"==typeof a.Component||w))return r.statusCode=405,r.setHeader("Allow",["GET","HEAD"]),await this.renderError(null,t,r,s),null;if("string"==typeof a.Component)return{type:"html",body:rH.fromStatic(a.Component)};if("amp"in i&&!i.amp&&delete i.amp,!0===n.supportsDynamicResponse){let r=r4(t.headers["user-agent"]||""),s="function"!=typeof(null==(p=a.Document)?void 0:p.getInitialProps)||eU in a.Document;n.supportsDynamicResponse=!w&&!r&&!i.amp&&s,n.isBot=r}!k&&j&&n.dev&&(n.supportsDynamicResponse=!0);let X=w?null==(l=this.nextConfig.i18n)?void 0:l.defaultLocale:i.__nextDefaultLocale,Y=i.__nextLocale,z=null==(u=this.nextConfig.i18n)?void 0:u.locales,Z=!1;if(A||w||j){let{tryGetPreviewData:s}=__webpack_require__("./dist/esm/server/api-utils/node/try-get-preview-data.js");Z=!1!==s(t,r,this.renderOpts.previewProps,!!this.nextConfig.experimental.multiZoneDraftMode)}j&&!n.dev&&!Z&&w&&R&&!V&&(!r$(n.runtime)||this.serverOptions.webServerConfig)&&nt(t.headers);let $=!1,ee=!1;w&&({isOnDemandRevalidate:$,revalidateOnlyGenerated:ee}=(0,eY.Gx)(t,this.renderOpts.previewProps)),w&&t.headers[e7.vx]&&(I=O),O=tL(O),I=tL(I),this.localeNormalizer&&(I=this.localeNormalizer.normalize(I));let et=t=>{let s={destination:t.pageProps.__N_REDIRECT,statusCode:t.pageProps.__N_REDIRECT_STATUS,basePath:t.pageProps.__N_REDIRECT_BASE_PATH},n=rZ(s),{basePath:a}=this.nextConfig;a&&!1!==s.basePath&&s.destination.startsWith("/")&&(s.destination=`${a}${s.destination}`),s.destination.startsWith("/")&&(s.destination=eh(s.destination)),r.redirect(s.destination,n).body(s.destination).send()};k&&(I=this.stripNextDataPath(I),O=this.stripNextDataPath(O));let er=null;Z||!w||n.supportsDynamicResponse||P||W||V||(er=`${Y?`/${Y}`:""}${("/"===s||"/"===I)&&Y?"":I}${i.amp?".amp":""}`),(v||E)&&w&&(er=`${Y?`/${Y}`:""}${s}${i.amp?".amp":""}`),er&&(er="/index"===(er=s9(er))&&"/"===s?"/":er);let es="https:";try{es=new URL(eE(t,"initURL")||"/","http://n").protocol}catch{}let en=globalThis.__incrementalCache||await this.getIncrementalCache({requestHeaders:Object.assign({},t.headers),requestProtocol:es.substring(0,es.length-1)});en.resetRequestCache();let ea=async({postponed:o,fallbackRouteParams:B})=>{let l,u=!k&&!0===n.dev||!w&&!S||"string"==typeof o||V,c=(0,d.parse)(t.url||"",!0).query;n.params&&Object.keys(n.params).forEach(t=>{delete c[t]});let p="/"!==O&&this.nextConfig.trailingSlash,C=(0,d.format)({pathname:`${I}${p?"/":""}`,query:c}),f={...a,...n,...j?{incrementalCache:en,isRevalidate:w&&!o&&!V,serverActions:this.nextConfig.experimental.serverActions}:{},isNextDataRequest:k,resolvedUrl:C,locale:Y,locales:z,defaultLocale:X,multiZoneDraftMode:this.nextConfig.experimental.multiZoneDraftMode,resolvedAsPath:A||_?(0,d.format)({pathname:`${O}${p?"/":""}`,query:c}):C,experimental:{...n.experimental,isRoutePPREnabled:K},supportsDynamicResponse:u,isOnDemandRevalidate:$,isDraftMode:Z,isServerAction:P,postponed:o,waitUntil:this.getWaitUntil(),onClose:r.onClose.bind(r),onAfterTaskError:void 0,setAppIsrStatus:this.setAppIsrStatus};if((J||U)&&(u=!1,f.nextExport=!0,f.supportsDynamicResponse=!1,f.isStaticGeneration=!0,f.isRevalidate=!0,f.isDebugStaticShell=J,f.isDebugDynamicAccesses=U),b){if(nr(b)){var m;if(!rA(t)||!rS(r))throw Object.defineProperty(Error("Invariant: App Route Route Modules cannot be used in the edge runtime"),"__NEXT_ERROR_CODE",{value:"E130",enumerable:!1});let a={params:n.params,prerenderManifest:F,renderOpts:{experimental:{dynamicIO:f.experimental.dynamicIO,authInterrupts:f.experimental.authInterrupts},supportsDynamicResponse:u,incrementalCache:en,cacheLifeProfiles:null==(m=this.nextConfig.experimental)?void 0:m.cacheLife,isRevalidate:w,waitUntil:this.getWaitUntil(),onClose:r.onClose.bind(r),onAfterTaskError:void 0,onInstrumentationRequestError:this.renderOpts.onInstrumentationRequestError,buildId:this.renderOpts.buildId}};try{let s=rI.fromNodeNextRequest(t,rO(r.originalResponse)),n=await b.handle(s,a);t.fetchMetrics=a.renderOpts.fetchMetrics;let i=a.renderOpts.collectedTags;if(w){let t=await n.blob(),r=rr(n.headers);i&&(r[e7.VC]=i),!r["content-type"]&&t.type&&(r["content-type"]=t.type);let s=void 0!==a.renderOpts.collectedRevalidate&&!(a.renderOpts.collectedRevalidate>=e7.AR)&&a.renderOpts.collectedRevalidate;return{value:{kind:tY.APP_ROUTE,status:n.status,body:Buffer.from(await t.arrayBuffer()),headers:r},revalidate:s,isFallback:!1}}return await s3(t,r,n,a.renderOpts.pendingWaitUntil),null}catch(n){if(await this.instrumentationOnRequestError(n,t,{routerKind:"App Router",routePath:s,routeType:"route",revalidateReason:nT(f)}),w)throw n;return tD(n),await s3(t,r,new Response(null,{status:500})),null}}else if(nn(b)||ns(b)){if("OPTIONS"===t.method&&!v)return await s3(t,r,new Response(null,{status:400})),null;if(nn(b)){f.nextFontManifest=this.nextFontManifest,f.clientReferenceManifest=a.clientReferenceManifest;let o=rA(t)?t.originalRequest:t,B=rS(r)?r.originalResponse:r;try{l=await b.render(o,B,{page:s,params:n.params,query:i,renderOpts:f})}catch(r){throw await this.instrumentationOnRequestError(r,t,{routerKind:"Pages Router",routePath:s,routeType:"render",revalidateReason:nT({isRevalidate:w,isOnDemandRevalidate:f.isOnDemandRevalidate})}),r}}else{let o=a.routeModule;f.nextFontManifest=this.nextFontManifest;let u={page:v?"/404":s,params:n.params,query:i,fallbackRouteParams:B,renderOpts:f,serverComponentsHmrCache:this.getServerComponentsHmrCache()};this.nextConfig.experimental.dynamicIO,l=await o.render(t,r,u)}}else throw Object.defineProperty(Error("Invariant: Unknown route module type"),"__NEXT_ERROR_CODE",{value:"E450",enumerable:!1})}else l=await this.renderHTML(t,r,s,i,f);let{metadata:h}=l,{headers:y={},fetchTags:g}=h;if(g&&(y[e7.VC]=g),t.fetchMetrics=h.fetchMetrics,j&&w&&0===h.revalidate&&!K){let t=h.staticBailoutInfo,r=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${O}${(null==t?void 0:t.description)?`, reason: ${t.description}`:""}
|
|
2872
|
-
see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1});if(null==t?void 0:t.stack){let s=t.stack;r.stack=r.message+s.substring(s.indexOf("\n"))}throw r}return"isNotFound"in h&&h.isNotFound?{value:null,revalidate:h.revalidate,isFallback:!1}:h.isRedirect?{value:{kind:tY.REDIRECT,props:h.pageData??h.flightData},revalidate:h.revalidate,isFallback:!1}:l.isNull?null:j?{value:{kind:tY.APP_PAGE,html:l,headers:y,rscData:h.flightData,postponed:h.postponed,status:r.statusCode,segmentData:h.segmentData},revalidate:h.revalidate,isFallback:!!B}:{value:{kind:tY.PAGES,html:l,pageData:h.pageData??h.flightData,headers:y,status:j?r.statusCode:void 0},revalidate:h.revalidate,isFallback:"true"===i.__nextFallback}},ei=async({hasResolved:o,previousCacheEntry:B,isRevalidating:l})=>{if(o||r.sent,!y&&N){if(S){let r=await this.getStaticPaths({pathname:s,requestHeaders:t.headers,isAppPath:j,page:a.page});y=r.staticPaths,g=r.fallbackMode}else y=void 0,g=nN.NOT_FOUND}g===nN.PRERENDER&&r4(t.headers["user-agent"]||"")&&(g=nN.BLOCKING_STATIC_RENDER),(null==B?void 0:B.isStale)===-1&&($=!0),$&&(g!==nN.NOT_FOUND||B)&&(g=nN.BLOCKING_STATIC_RENDER);let u=er;!u&&n.dev&&j&&(u=s9(I)),u&&i.amp&&(u=u.replace(/\.amp$/,"")),u&&(null==y||y.includes(u)),this.nextConfig.experimental.isExperimentalCompile&&(g=nN.BLOCKING_STATIC_RENDER);let c=$||l||!W?void 0:W;if((J||U)&&void 0!==c)return{revalidate:1,isFallback:!1,value:{kind:tY.PAGES,html:rH.fromStatic(""),pageData:{},headers:void 0,status:void 0}};let d=N&&K&&(eE(t,"didSetDefaultRouteMatches")||Q)?tX(s):null,p=await ea({postponed:c,fallbackRouteParams:d});return p?{...p,revalidate:p.revalidate}:null},eo=await this.responseCache.get(er,ei,{routeKind:(null==b?void 0:b.definition.kind)??(j?rG.APP_PAGE:rG.PAGES),incrementalCache:en,isOnDemandRevalidate:$,isPrefetch:"prefetch"===t.headers.purpose,isRoutePPREnabled:K});if(K&&"string"==typeof q){if(r.setHeader(tB,"2"),null!==eo&&(null==(C=eo.value)?void 0:C.kind)===tY.APP_PAGE&&eo.value.segmentData){let t=eo.value.segmentData.get(q);if(void 0!==t)return{type:"rsc",body:rH.fromStatic(t),revalidate:eo.revalidate}}return r.statusCode=204,{type:"rsc",body:rH.fromStatic(""),revalidate:null==eo?void 0:eo.revalidate}}if(Z&&r.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),!eo){if(er&&!($&&ee))throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1});return null}let eB=(null==(c=eo.value)?void 0:c.kind)===tY.APP_PAGE&&"string"==typeof eo.value.postponed;w&&!V&&(!eB||M)&&r.setHeader(tl,"1");let{value:el}=eo;if((null==el?void 0:el.kind)===tY.IMAGE)throw Object.defineProperty(Error("invariant SSG should not return an image cache value"),"__NEXT_ERROR_CODE",{value:"E390",enumerable:!1});if(W)D=0;else if(R&&!M&&K)D=0;else if(1){if(Z)D=0;else if(w){if(v){let r=eE(t,"notFoundRevalidate");D=void 0===r?0:r}else if(E)D=0;else if("number"==typeof eo.revalidate){if(eo.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${eo.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1});D=eo.revalidate}else!1===eo.revalidate&&(D=e7.qF)}else r.getHeader("Cache-Control")||(D=0)}eo.revalidate=D;let eu=eE(t,"onCacheEntry");if(eu&&await eu({...eo,value:{...eo.value,kind:(null==(f=eo.value)?void 0:f.kind)===tY.APP_PAGE?"PAGE":null==(m=eo.value)?void 0:m.kind}},{url:eE(t,"initURL")}))return null;if(el){if(el.kind===tY.REDIRECT)return(void 0===eo.revalidate||r.getHeader("Cache-Control")||r.setHeader("Cache-Control",e9({revalidate:eo.revalidate,expireTime:this.nextConfig.expireTime})),k)?{type:"json",body:rH.fromStatic(JSON.stringify(el.props)),revalidate:eo.revalidate}:(await et(el.props),null);if(el.kind===tY.APP_ROUTE){let s=re(el.headers);return w||s.delete(e7.VC),void 0===eo.revalidate||r.getHeader("Cache-Control")||s.get("Cache-Control")||s.set("Cache-Control",e9({revalidate:eo.revalidate,expireTime:this.nextConfig.expireTime})),await s3(t,r,new Response(el.body,{headers:s,status:el.status||200})),null}if(el.kind===tY.APP_PAGE){if(eB&&W)throw Object.defineProperty(Error("Invariant: postponed state should not be present on a resume request"),"__NEXT_ERROR_CODE",{value:"E396",enumerable:!1});if(el.headers){let t={...el.headers};for(let[s,n]of(w||delete t[e7.VC],Object.entries(t)))if(void 0!==n){if(Array.isArray(n))for(let t of n)r.appendHeader(s,t);else"number"==typeof n&&(n=n.toString()),r.appendHeader(s,n)}}if(w&&(null==(h=el.headers)?void 0:h[e7.VC])&&r.setHeader(e7.VC,el.headers[e7.VC]),!el.status||R&&K||(r.statusCode=el.status),eB&&r.setHeader(tB,"1"),R&&!Z){if(void 0===el.rscData){if(el.postponed)throw Object.defineProperty(Error("Invariant: Expected postponed to be undefined"),"__NEXT_ERROR_CODE",{value:"E372",enumerable:!1});return{type:"rsc",body:el.html,revalidate:V?0:eo.revalidate}}return{type:"rsc",body:rH.fromStatic(el.rscData),revalidate:eo.revalidate}}return{type:"html",body:el.html,revalidate:eo.revalidate}}return k?{type:"json",body:rH.fromStatic(JSON.stringify(el.pageData)),revalidate:eo.revalidate}:{type:"html",body:el.html,revalidate:eo.revalidate}}return(eA(t,"notFoundRevalidate",eo.revalidate),void 0===eo.revalidate||r.getHeader("Cache-Control")||r.setHeader("Cache-Control",e9({revalidate:eo.revalidate,expireTime:this.nextConfig.expireTime})),k)?(r.statusCode=404,r.body('{"notFound":true}').send()):await this.render404(t,r,{pathname:s,query:i},!1),null}stripNextDataPath(t,r=!0){return(t.includes(this.buildId)&&(t=r7(t.substring(t.indexOf(this.buildId)+this.buildId.length).replace(/\.json$/,""))),this.localeNormalizer&&r)?this.localeNormalizer.normalize(t):t}getOriginalAppPaths(t){if(this.enabledDirectories.app){var r;return(null==(r=this.appPathRoutes)?void 0:r[t])||null}return null}async renderPageComponent(t,r){var s;let{query:n,pathname:a}=t,i=this.getOriginalAppPaths(a),o=Array.isArray(i),B=a;o&&(B=i[i.length-1]);let l=await this.findPageComponents({page:B,query:n,params:t.renderOpts.params||{},isAppPath:o,sriEnabled:!!(null==(s=this.nextConfig.experimental.sri)?void 0:s.algorithm),appPaths:i,shouldEnsure:!1});if(l){(0,t0.getTracer)().setRootSpanAttribute("next.route",a);try{return await this.renderToResponseWithComponents(t,l)}catch(s){let t=s instanceof nk;if(!t||t&&r)throw s}}return!1}async renderToResponse(t){return(0,t0.getTracer)().trace(t2.Li.renderToResponse,{spanName:"rendering page",attributes:{"next.route":t.pathname}},async()=>this.renderToResponseImpl(t))}async renderToResponseImpl(t){var r;let{res:s,query:n,pathname:a}=t,i=a,o=!!n._nextBubbleNoFallback;delete n[to],delete n._nextBubbleNoFallback;let B={i18n:null==(r=this.i18nProvider)?void 0:r.fromQuery(a,n)};try{for await(let r of this.matchers.matchAll(a,B)){eE(t.req,"invokeOutput");let s=await this.renderPageComponent({...t,pathname:r.definition.pathname,renderOpts:{...t.renderOpts,params:r.params}},o);if(!1!==s)return s}if(this.serverOptions.webServerConfig){t.pathname=this.serverOptions.webServerConfig.page;let r=await this.renderPageComponent(t,o);if(!1!==r)return r}}catch(a){let r=sC(a);if(a instanceof eD)throw console.error("Invariant: failed to load static page",JSON.stringify({page:i,url:t.req.url,matchedPath:t.req.headers[e7.vx],initUrl:eE(t.req,"initURL"),didRewrite:!!eE(t.req,"rewroteURL"),rewroteUrl:eE(t.req,"rewroteURL")},null,2)),r;if(r instanceof nk&&o)throw r;if(r instanceof ey||r instanceof eg)return s.statusCode=400,await this.renderErrorToResponse(t,r);s.statusCode=500,await this.hasPage("/500")&&(t.query.__nextCustomErrorRender="1",await this.renderErrorToResponse(t,r),delete t.query.__nextCustomErrorRender);let n=r instanceof nM;if(!n)throw sd(r)&&(r.page=i),r;return await this.renderErrorToResponse(t,n?r.innerError:r)}return this.getMiddleware()&&t.req.headers["x-nextjs-data"]&&(!s.statusCode||200===s.statusCode||404===s.statusCode)?(s.setHeader("x-nextjs-matched-path",`${n.__nextLocale?`/${n.__nextLocale}`:""}${a}`),s.statusCode=200,s.setHeader("content-type","application/json"),s.body("{}"),s.send(),null):(s.statusCode=404,this.renderErrorToResponse(t,null))}async renderToHTML(t,r,s,n={}){return(0,t0.getTracer)().trace(t2.Li.renderToHTML,async()=>this.renderToHTMLImpl(t,r,s,n))}async renderToHTMLImpl(t,r,s,n={}){return this.getStaticHTML(t=>this.renderToResponse(t),{req:t,res:r,pathname:s,query:n})}async renderError(t,r,s,n,a={},i=!0){return(0,t0.getTracer)().trace(t2.Li.renderError,async()=>this.renderErrorImpl(t,r,s,n,a,i))}async renderErrorImpl(t,r,s,n,a={},i=!0){return i&&s.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),this.pipe(async r=>{let n=await this.renderErrorToResponse(r,t);if(500===s.statusCode)throw t;return n},{req:r,res:s,pathname:n,query:a})}async renderErrorToResponse(t,r){return(0,t0.getTracer)().trace(t2.Li.renderErrorToResponse,async()=>this.renderErrorToResponseImpl(t,r))}async renderErrorToResponseImpl(t,r){let{res:s,query:n}=t;try{let a=null,i=404===s.statusCode,o=!1;i&&(this.enabledDirectories.app&&(a=await this.findPageComponents({page:ew,query:n,params:{},isAppPath:!0,shouldEnsure:!0,url:t.req.url}),o=null!==a),!a&&await this.hasPage("/404")&&(a=await this.findPageComponents({page:"/404",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:t.req.url}),o=null!==a));let B=`/${s.statusCode}`;if(!t.query.__nextCustomErrorRender&&!a&&eq.includes(B)&&(a=await this.findPageComponents({page:B,query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:t.req.url})),a||(a=await this.findPageComponents({page:"/_error",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:t.req.url}),B="/_error"),!a)throw new nM(Object.defineProperty(Error("missing required error components"),"__NEXT_ERROR_CODE",{value:"E60",enumerable:!1}));a.components.routeModule?eA(t.req,"match",{definition:a.components.routeModule.definition,params:void 0}):eS(t.req,"match");try{return await this.renderToResponseWithComponents({...t,pathname:B,renderOpts:{...t.renderOpts,err:r}},a)}catch(t){if(t instanceof nk)throw Object.defineProperty(Error("invariant: failed to render error page"),"__NEXT_ERROR_CODE",{value:"E55",enumerable:!1});throw t}}catch(o){let r=sC(o),a=r instanceof nM;a||this.logError(r),s.statusCode=500;let i=await this.getFallbackErrorComponents(t.req.url);if(i)return eA(t.req,"match",{definition:i.routeModule.definition,params:void 0}),this.renderToResponseWithComponents({...t,pathname:"/_error",renderOpts:{...t.renderOpts,err:a?r.innerError:r}},{query:n,components:i});return{type:"html",body:rH.fromStatic("Internal Server Error")}}}async renderErrorToHTML(t,r,s,n,a={}){return this.getStaticHTML(r=>this.renderErrorToResponse(r,t),{req:r,res:s,pathname:n,query:a})}async render404(t,r,s,n=!0){let{pathname:a,query:i}=s||(0,d.parse)(t.url,!0);return this.nextConfig.i18n&&(i.__nextLocale||=this.nextConfig.i18n.defaultLocale,i.__nextDefaultLocale||=this.nextConfig.i18n.defaultLocale),r.statusCode=404,this.renderError(null,t,r,a,i,n)}}let nL=require("vm");function nH(t){if(Object.isFrozen(t))return t;if(Array.isArray(t)){for(let r of t)r&&"object"==typeof r&&nH(r);return Object.freeze(t)}for(let r of Object.values(t))r&&"object"==typeof r&&nH(r);return Object.freeze(t)}let nG=new Map;function nK(t,r=!0,s=nG){let n=r&&s.get(t);if(n)return n;let a=JSON.parse((0,C.readFileSync)(t,"utf8"));return r&&(a=nH(a)),r&&s.set(t,a),a}function nJ(t,r=!0,s=nG){let n=r&&s.get(t);if(n)return n;let a=(0,C.readFileSync)(t,"utf8");if(0===a.length)throw Object.defineProperty(Error("Manifest file is empty"),"__NEXT_ERROR_CODE",{value:"E328",enumerable:!1});let i={};return(0,nL.runInNewContext)(a,i),r&&(i=nH(i)),r&&s.set(t,i),i}let nU=!1,nQ=new tf(1e3);function nW(t,r,s,n){let a;let i=`${t}:${r}:${s}:${n}`,o=null==nQ?void 0:nQ.get(i);if(o)return o;let B=c().join(r,eH);n&&(a=nK(c().join(B,eT),!nU));let l=nK(c().join(B,eI),!nU);try{t=r7(sA(t))}catch(r){throw console.error(r),new eb(t)}let u=r=>{let n=r[t];if(!r[n]&&s){let a={};for(let t of Object.keys(r))a[rp(t,s).pathname]=l[t];n=a[t]}return n};return(a&&(o=u(a)),o||(o=u(l)),o)?(o=c().join(B,o),null==nQ||nQ.set(i,o),o):(null==nQ||nQ.set(i,null),null)}function nV(t,r,s,n){let a=nW(t,r,s,n);if(!a)throw new eb(t);return a}async function nq(t,r,s){let n=nV(t,r,void 0,s);if(n.endsWith(".html"))return C.promises.readFile(n,"utf8").catch(r=>{throw new eD(t,r.message)});try{return process.env.__NEXT_PRIVATE_RUNTIME_TYPE=s?"app":"pages",require(n)}finally{process.env.__NEXT_PRIVATE_RUNTIME_TYPE=""}}function nX(t){return t.default||t}async function nY(t){return new Promise(r=>setTimeout(r,t))}let nz=Symbol.for("next.server.action-manifests");function nZ({page:t,clientReferenceManifest:r,serverActionsManifest:s,serverModuleMap:n}){var a;let i=null==(a=globalThis[nz])?void 0:a.clientReferenceManifestsPerPage;globalThis[nz]={clientReferenceManifestsPerPage:{...i,[tO(t)]:r},serverActionsManifest:s,serverModuleMap:n}}function n$({serverActionsManifest:t}){return new Proxy({},{get:(r,s)=>{let n;let a=t.node[s].workers,i=W.workAsyncStorage.getStore();if(!(n=i?a[n1(i.page)]:Object.values(a).at(0)))return;let{moduleId:o,async:B}=n;return{id:o,name:s,chunks:[],async:B}}})}function n1(t){return rl(t,"app")?t:"app"+t}async function n0(t,r=3){for(;;)try{return nK(t)}catch(t){if(--r<=0)throw t;await nY(100)}}async function n2(t,r=3){for(;;)try{return nJ(t)}catch(t){if(--r<=0)throw t;await nY(100)}}async function n3(t,r){try{return(await n2(t)).__RSC_MANIFEST[r]}catch(t){return}}async function n5({distDir:t,page:r,isAppPath:s}){let n={},a={};s||([n,a]=await Promise.all([nq("/_document",t,!1),nq("/_app",t,!1)]));let i=s&&!sT(r),[o,B,l,c,d]=await Promise.all([n0((0,u.join)(t,eN)),n0((0,u.join)(t,eL)),s?void 0:n0((0,u.join)(t,`${eV}.json`)).catch(()=>void 0),i?n3((0,u.join)(t,"server","app",r.replace(/%5F/g,"_")+"_"+eQ+".js"),r.replace(/%5F/g,"_")):void 0,s?n0((0,u.join)(t,"server",eW+".json")).catch(()=>null):null]);d&&c&&nZ({page:r,clientReferenceManifest:c,serverActionsManifest:d,serverModuleMap:n$({serverActionsManifest:d})});let p=await nq(r,t,s),C=nX(p),f=nX(n),m=nX(a),{getServerSideProps:h,getStaticProps:y,getStaticPaths:g,routeModule:b}=p;return{App:m,Document:f,Component:C,buildManifest:o,reactLoadableManifest:B,dynamicCssManifest:l,pageConfig:p.config||{},ComponentMod:p,getServerSideProps:h,getStaticProps:y,getStaticPaths:g,clientReferenceManifest:c,serverActionsManifest:d,isAppPath:s,page:r,routeModule:b}}let n4=(0,t0.getTracer)().wrap(t2.p2.loadComponents,n5);function n6(t){return(r,s,n)=>{for(let a of t)if(new RegExp(a.regexp).exec(r)&&(!a.has&&!a.missing||ss(s,n,a.has,a.missing)))return!0;return!1}}var n7=__webpack_require__("../next-env/dist/index.js");let n9=require("stream");var n8=/*#__PURE__*/__webpack_require__.n(n9);function ae(t,r){for(let s in r){let n=r[s];"function"==typeof n&&(n=n.bind(t)),t[s]=n}return t}function at(t){let r=null,s=new Promise((r,s)=>{t.on("end",r),t.on("error",s)}).catch(t=>({error:t}));return{async finalize(){if(r){let n=await s;if(n&&"object"==typeof n&&n.error)throw n.error;ae(t,r),r=t}},cloneBodyStream(){let s=r??t,n=new n9.PassThrough,a=new n9.PassThrough;return s.on("data",t=>{n.push(t),a.push(t)}),s.on("end",()=>{n.push(null),a.push(null)}),r=a,n}}}let ar=require("next/dist/server/lib/incremental-cache/tags-manifest.external.js");class as{constructor(t){this.fs=t.fs,this.flushToDisk=t.flushToDisk,this.serverDistDir=t.serverDistDir,this.revalidatedTags=t.revalidatedTags,this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE,t.maxMemoryCacheSize?s||(this.debug&&console.log("using memory store for fetch cache"),s=new tf(t.maxMemoryCacheSize,function({value:t}){var r;if(!t)return 25;if(t.kind===tY.REDIRECT)return JSON.stringify(t.props).length;if(t.kind===tY.IMAGE)throw Object.defineProperty(Error("invariant image should not be incremental-cache"),"__NEXT_ERROR_CODE",{value:"E501",enumerable:!1});return t.kind===tY.FETCH?JSON.stringify(t.data||"").length:t.kind===tY.APP_ROUTE?t.body.length:t.html.length+((null==(r=JSON.stringify(t.kind===tY.APP_PAGE?t.rscData:t.pageData))?void 0:r.length)||0)})):this.debug&&console.log("not using memory store for fetch cache")}resetRequestCache(){}async revalidateTag(...t){let[r]=t;if(r="string"==typeof r?[r]:r,this.debug&&console.log("revalidateTag",r),0!==r.length)for(let t of r){let r=ar.tagsManifest.items[t]||{};r.revalidatedAt=Date.now(),ar.tagsManifest.items[t]=r}}async get(...t){var r,n,a,i,o,B;let[l,u]=t,{tags:c,softTags:d,kind:p,isRoutePPREnabled:C,isFallback:f}=u,m=null==s?void 0:s.get(l);if(this.debug&&console.log("get",l,c,p,!!m),!m){if(p===tz.APP_ROUTE)try{let t=this.getFilePath(`${l}.body`,tz.APP_ROUTE),r=await this.fs.readFile(t),{mtime:s}=await this.fs.stat(t),n=JSON.parse(await this.fs.readFile(t.replace(/\.body$/,e7.EP),"utf8"));return{lastModified:s.getTime(),value:{kind:tY.APP_ROUTE,body:r,headers:n.headers,status:n.status}}}catch{return null}try{let t=this.getFilePath(p===tz.FETCH?l:`${l}.html`,p),r=await this.fs.readFile(t,"utf8"),{mtime:n}=await this.fs.stat(t);if(p===tz.FETCH){if(!this.flushToDisk)return null;let t=n.getTime(),s=JSON.parse(r);if(m={lastModified:t,value:s},(null==(i=m.value)?void 0:i.kind)===tY.FETCH){let t=null==(o=m.value)?void 0:o.tags;(null==c?void 0:c.every(r=>null==t?void 0:t.includes(r)))||(this.debug&&console.log("tags vs storedTags mismatch",c,t),await this.set(l,m.value,{tags:c,isRoutePPREnabled:C}))}}else if(p===tz.APP_PAGE){let s,a,i;try{s=JSON.parse(await this.fs.readFile(t.replace(/\.html$/,e7.EP),"utf8"))}catch{}if(null==s?void 0:s.segmentPaths){let t=new Map;a=t;let r=l+e7.mH;await Promise.all(s.segmentPaths.map(async s=>{let n=this.getFilePath("/"===s?r+"/_index"+e7.tz:r+s+e7.tz,tz.APP_PAGE);try{t.set(s,await this.fs.readFile(n))}catch{}}))}f||(i=await this.fs.readFile(this.getFilePath(`${l}${C?e7.pu:e7.RM}`,tz.APP_PAGE))),m={lastModified:n.getTime(),value:{kind:tY.APP_PAGE,html:r,rscData:i,postponed:null==s?void 0:s.postponed,headers:null==s?void 0:s.headers,status:null==s?void 0:s.status,segmentData:a}}}else if(p===tz.PAGES){let t;let s={};f||(s=JSON.parse(await this.fs.readFile(this.getFilePath(`${l}${e7.x3}`,tz.PAGES),"utf8"))),m={lastModified:n.getTime(),value:{kind:tY.PAGES,html:r,pageData:s,headers:null==t?void 0:t.headers,status:null==t?void 0:t.status}}}else throw Object.defineProperty(Error(`Invariant: Unexpected route kind ${p} in file system cache.`),"__NEXT_ERROR_CODE",{value:"E445",enumerable:!1});m&&(null==s||s.set(l,m))}catch{return null}}if((null==m?void 0:null==(r=m.value)?void 0:r.kind)===tY.APP_PAGE||(null==m?void 0:null==(n=m.value)?void 0:n.kind)===tY.PAGES){let t;let r=null==(B=m.value.headers)?void 0:B[e7.VC];if("string"==typeof r&&(t=r.split(",")),(null==t?void 0:t.length)&&t.some(t=>{var r;return(null==ar.tagsManifest?void 0:null==(r=ar.tagsManifest.items[t])?void 0:r.revalidatedAt)&&(null==ar.tagsManifest?void 0:ar.tagsManifest.items[t].revalidatedAt)>=((null==m?void 0:m.lastModified)||Date.now())}))return null}else(null==m?void 0:null==(a=m.value)?void 0:a.kind)===tY.FETCH&&[...c||[],...d||[]].some(t=>{var r;return!!this.revalidatedTags.includes(t)||(null==ar.tagsManifest?void 0:null==(r=ar.tagsManifest.items[t])?void 0:r.revalidatedAt)&&(null==ar.tagsManifest?void 0:ar.tagsManifest.items[t].revalidatedAt)>=((null==m?void 0:m.lastModified)||Date.now())})&&(m=void 0);return m??null}async set(...t){let[r,n,a]=t,{isFallback:i}=a;if(null==s||s.set(r,{value:n,lastModified:Date.now()}),this.debug&&console.log("set",r),this.flushToDisk&&n){if(n.kind===tY.APP_ROUTE){let t=this.getFilePath(`${r}.body`,tz.APP_ROUTE);await this.fs.mkdir(sE().dirname(t)),await this.fs.writeFile(t,n.body);let s={headers:n.headers,status:n.status,postponed:void 0,segmentPaths:void 0};await this.fs.writeFile(t.replace(/\.body$/,e7.EP),JSON.stringify(s,null,2))}else if(n.kind===tY.PAGES||n.kind===tY.APP_PAGE){let t=n.kind===tY.APP_PAGE,s=this.getFilePath(`${r}.html`,t?tz.APP_PAGE:tz.PAGES);if(await this.fs.mkdir(sE().dirname(s)),await this.fs.writeFile(s,n.html),i||await this.fs.writeFile(this.getFilePath(`${r}${t?a.isRoutePPREnabled?e7.pu:e7.RM:e7.x3}`,t?tz.APP_PAGE:tz.PAGES),t?n.rscData:JSON.stringify(n.pageData)),(null==n?void 0:n.kind)===tY.APP_PAGE){let t={headers:n.headers,status:n.status,postponed:n.postponed,segmentPaths:void 0};await this.fs.writeFile(s.replace(/\.html$/,e7.EP),JSON.stringify(t))}}else if(n.kind===tY.FETCH){let t=this.getFilePath(r,tz.FETCH);await this.fs.mkdir(sE().dirname(t)),await this.fs.writeFile(t,JSON.stringify({...n,tags:a.tags}))}}}getFilePath(t,r){switch(r){case tz.FETCH:return sE().join(this.serverDistDir,"..","cache","fetch-cache",t);case tz.PAGES:return sE().join(this.serverDistDir,"pages",t);case tz.IMAGE:case tz.APP_PAGE:case tz.APP_ROUTE:return sE().join(this.serverDistDir,"app",t);default:throw Object.defineProperty(Error(`Unexpected file path kind: ${r}`),"__NEXT_ERROR_CODE",{value:"E479",enumerable:!1})}}}class an{static #e=this.timings=new Map;constructor(t){this.prerenderManifest=t}get(t){var r,s;let n=an.timings.get(t);if(void 0!==n||void 0!==(n=null==(r=this.prerenderManifest.routes[t])?void 0:r.initialRevalidateSeconds)||void 0!==(n=null==(s=this.prerenderManifest.dynamicRoutes[t])?void 0:s.fallbackRevalidate))return n}set(t,r){an.timings.set(t,r)}clear(){an.timings.clear()}}let aa=nm();class ai{constructor({fs:t,dev:r,dynamicIO:s,flushToDisk:n,minimalMode:a,serverDistDir:i,requestHeaders:o,requestProtocol:B,maxMemoryCacheSize:l,getPrerenderManifest:u,fetchCacheKeyPrefix:c,CurCacheHandler:d,allowedRevalidateHeaderKeys:p}){var C,f,m,h;this.locks=new Map;let y=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;this.hasCustomCacheHandler=!!d;let g=Symbol.for("@next/cache-handlers"),b=globalThis;if(d)y&&console.log("using custom cache handler",d.name);else{let r=b[g];(null==r?void 0:r.FetchCache)?d=r.FetchCache:t&&i&&(y&&console.log("using filesystem cache handler"),d=as)}process.env.__NEXT_TEST_MAX_ISR_CACHE&&(l=parseInt(process.env.__NEXT_TEST_MAX_ISR_CACHE,10)),this.dev=r,this.hasDynamicIO=s,this.disableForTestmode="true"===process.env.NEXT_PRIVATE_TEST_PROXY,this.minimalMode=a,this.requestHeaders=o,this.requestProtocol=B,this.allowedRevalidateHeaderKeys=p,this.prerenderManifest=u(),this.revalidateTimings=new an(this.prerenderManifest),this.fetchCacheKeyPrefix=c;let D=[];o[e7.kz]===(null==(f=this.prerenderManifest)?void 0:null==(C=f.preview)?void 0:C.previewModeId)&&(this.isOnDemandRevalidate=!0),a&&"string"==typeof o[e7.vS]&&o[e7.c1]===(null==(h=this.prerenderManifest)?void 0:null==(m=h.preview)?void 0:m.previewModeId)&&(D=o[e7.vS].split(",")),d&&(this.cacheHandler=new d({dev:r,fs:t,flushToDisk:n,serverDistDir:i,revalidatedTags:D,maxMemoryCacheSize:l,_requestHeaders:o,fetchCacheKeyPrefix:c}))}calculateRevalidate(t,r,s,n){if(s)return Math.floor(performance.timeOrigin+performance.now()-1e3);let a=this.revalidateTimings.get(nu(t))??(!n&&1);return"number"==typeof a?1e3*a+r:a}_getPathname(t,r){return r?t:sA(t)}resetRequestCache(){var t,r;null==(r=this.cacheHandler)||null==(t=r.resetRequestCache)||t.call(r)}async lock(t){let r=()=>Promise.resolve(),s=this.locks.get(t);s&&await s;let n=new Promise(s=>{r=async()=>{s(),this.locks.delete(t)}});return this.locks.set(t,n),r}async revalidateTag(t){var r,s;return null==(s=this.cacheHandler)?void 0:null==(r=s.revalidateTag)?void 0:r.call(s,t)}async generateCacheKey(t,r={}){let s="v3",n=[],a=new TextEncoder,i=new TextDecoder;if(r.body){if("function"==typeof r.body.getReader){let t=r.body,s=[];try{await t.pipeTo(new WritableStream({write(t){"string"==typeof t?(s.push(a.encode(t)),n.push(t)):(s.push(t),n.push(i.decode(t,{stream:!0})))}})),n.push(i.decode());let o=s.reduce((t,r)=>t+r.length,0),B=new Uint8Array(o),l=0;for(let t of s)B.set(t,l),l+=t.length;r._ogBody=B}catch(t){console.error("Problem reading body",t)}}else if("function"==typeof r.body.keys){let t=r.body;for(let s of(r._ogBody=r.body,new Set([...t.keys()]))){let r=t.getAll(s);n.push(`${s}=${(await Promise.all(r.map(async t=>"string"==typeof t?t:await t.text()))).join(",")}`)}}else if("function"==typeof r.body.arrayBuffer){let t=r.body,s=await t.arrayBuffer();n.push(await t.text()),r._ogBody=new Blob([s],{type:t.type})}else"string"==typeof r.body&&(n.push(r.body),r._ogBody=r.body)}let o="function"==typeof(r.headers||{}).keys?Object.fromEntries(r.headers):Object.assign({},r.headers);"traceparent"in o&&delete o.traceparent;let B=JSON.stringify([s,this.fetchCacheKeyPrefix||"",t,r.method,o,r.mode,r.redirect,r.credentials,r.referrer,r.referrerPolicy,r.integrity,r.cache,n]);return __webpack_require__("crypto").createHash("sha256").update(B).digest("hex")}async get(t,r){var s,n;let a,i;if(this.hasDynamicIO&&r.kind===tz.FETCH){let r=aa.getStore(),s=r?(0,F.getRenderResumeDataCache)(r):null;if(s){let r=s.fetch.get(t);if((null==r?void 0:r.kind)===tY.FETCH)return{isStale:!1,value:r,revalidateAfter:!1,isFallback:!1}}}if(this.disableForTestmode||this.dev&&(r.kind!==tz.FETCH||"no-cache"===this.requestHeaders["cache-control"]))return null;let{isFallback:o}=r;t=this._getPathname(t,r.kind===tz.FETCH);let B=null,l=r.revalidate,u=await (null==(s=this.cacheHandler)?void 0:s.get(t,r));if((null==u?void 0:null==(n=u.value)?void 0:n.kind)===tY.FETCH){if([...r.tags||[],...r.softTags||[]].some(t=>{var r;return null==(r=this.revalidatedTags)?void 0:r.includes(t)}))return null;l=l||u.value.revalidate;let t=(performance.timeOrigin+performance.now()-(u.lastModified||0))/1e3>l,s=u.value.data;return{isStale:t,value:{kind:tY.FETCH,data:s,revalidate:l},revalidateAfter:performance.timeOrigin+performance.now()+1e3*l,isFallback:o}}let c=this.revalidateTimings.get(nu(t));return(null==u?void 0:u.lastModified)===-1?(a=-1,i=-1*e7.qF):a=!!(!1!==(i=this.calculateRevalidate(t,(null==u?void 0:u.lastModified)||performance.timeOrigin+performance.now(),!!this.dev&&r.kind!==tz.FETCH,r.isFallback))&&i<performance.timeOrigin+performance.now())||void 0,u&&(B={isStale:a,curRevalidate:c,revalidateAfter:i,value:u.value,isFallback:o}),!u&&this.prerenderManifest.notFoundRoutes.includes(t)&&(B={isStale:a,value:null,curRevalidate:c,revalidateAfter:i,isFallback:o},this.set(t,B.value,r)),B}async set(t,r,s){if(this.hasDynamicIO&&(null==r?void 0:r.kind)===tY.FETCH){let s=aa.getStore(),n=s?(0,F.getPrerenderResumeDataCache)(s):null;n&&n.fetch.set(t,r)}if(this.disableForTestmode||this.dev&&!s.fetchCache)return;t=this._getPathname(t,s.fetchCache);let n=JSON.stringify(r).length;if(s.fetchCache&&!this.hasCustomCacheHandler&&n>2097152){if(this.dev)throw Object.defineProperty(Error(`Failed to set Next.js data cache, items over 2MB can not be cached (${n} bytes)`),"__NEXT_ERROR_CODE",{value:"E86",enumerable:!1});return}try{var a;void 0===s.revalidate||s.fetchCache||this.revalidateTimings.set(nu(t),s.revalidate),await (null==(a=this.cacheHandler)?void 0:a.set(t,r,s))}catch(r){console.warn("Failed to update prerender cache for",t,r)}}}let ao=require("http"),aB=require("https");function al(t){if(!globalThis.__NEXT_HTTP_AGENT){if(!t)throw Object.defineProperty(Error("Expected config.httpAgentOptions to be an object"),"__NEXT_ERROR_CODE",{value:"E204",enumerable:!1});globalThis.__NEXT_HTTP_AGENT_OPTIONS=t.httpAgentOptions,globalThis.__NEXT_HTTP_AGENT=new ao.Agent(t.httpAgentOptions),globalThis.__NEXT_HTTPS_AGENT=new aB.Agent(t.httpAgentOptions)}}function au(t){return t.definition.kind===rG.PAGES_API}let ac={existsSync:f().existsSync,readFile:f().promises.readFile,readFileSync:f().readFileSync,writeFile:(t,r)=>f().promises.writeFile(t,r),mkdir:t=>f().promises.mkdir(t,{recursive:!0}),stat:t=>f().promises.stat(t)};class ad extends n8().Readable{constructor({url:t,headers:r,method:s,socket:n=null,readable:a}){super(),this.httpVersion="1.0",this.httpVersionMajor=1,this.httpVersionMinor=0,this.socket=new Proxy({},{get:(t,r)=>{if("encrypted"!==r&&"remoteAddress"!==r)throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1});if("remoteAddress"!==r)return!1}}),this.url=t,this.headers=r,this.method=s,a&&(this.bodyReadable=a,this.bodyReadable.on("end",()=>this.emit("end")),this.bodyReadable.on("close",()=>this.emit("close"))),n&&(this.socket=n)}get headersDistinct(){let t={};for(let[r,s]of Object.entries(this.headers))s&&(t[r]=Array.isArray(s)?s:[s]);return t}_read(t){if(this.bodyReadable)return this.bodyReadable._read(t);this.emit("end"),this.emit("close")}get connection(){return this.socket}get aborted(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1})}get complete(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1})}get trailers(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1})}get trailersDistinct(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1})}get rawTrailers(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1})}get rawHeaders(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}setTimeout(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}}class ap extends n8().Writable{constructor(t={}){super(),this.statusMessage="",this.finished=!1,this.headersSent=!1,this.buffers=[],this.statusCode=t.statusCode??200,this.socket=t.socket??null,this.headers=t.headers?re(t.headers):new Headers,this.headPromise=new Promise(t=>{this.headPromiseResolve=t}),this.hasStreamed=new Promise((t,r)=>{this.on("finish",()=>t(!0)),this.on("end",()=>t(!0)),this.on("error",t=>r(t))}).then(t=>(null==this.headPromiseResolve||this.headPromiseResolve.call(this),t)),t.resWriter&&(this.resWriter=t.resWriter)}appendHeader(t,r){for(let s of Array.isArray(r)?r:[r])this.headers.append(t,s);return this}get isSent(){return this.finished||this.headersSent}get connection(){return this.socket}write(t){return this.resWriter?this.resWriter(t):(this.buffers.push(Buffer.isBuffer(t)?t:Buffer.from(t)),!0)}end(){return this.finished=!0,super.end(...arguments)}_implicitHeader(){}_write(t,r,s){this.write(t),s()}writeHead(t,r,s){if(s||"string"==typeof r?"string"==typeof r&&r.length>0&&(this.statusMessage=r):s=r,s){if(Array.isArray(s))for(let t=0;t<s.length;t+=2)this.setHeader(s[t],s[t+1]);else for(let[t,r]of Object.entries(s))void 0!==r&&this.setHeader(t,r)}return this.statusCode=t,this.headersSent=!0,null==this.headPromiseResolve||this.headPromiseResolve.call(this),this}hasHeader(t){return this.headers.has(t)}getHeader(t){return this.headers.get(t)??void 0}getHeaders(){return rr(this.headers)}getHeaderNames(){return Array.from(this.headers.keys())}setHeader(t,r){if(Array.isArray(r))for(let s of(this.headers.delete(t),r))this.headers.append(t,s);else"number"==typeof r?this.headers.set(t,r.toString()):this.headers.set(t,r);return this}removeHeader(t){this.headers.delete(t)}flushHeaders(){}get strictContentLength(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}writeEarlyHints(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}get req(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}assignSocket(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}detachSocket(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}writeContinue(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}writeProcessing(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}get upgrading(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}get chunkedEncoding(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}get shouldKeepAlive(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}get useChunkedEncodingByDefault(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}get sendDate(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}setTimeout(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}addTrailers(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}setHeaders(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}}function aC({url:t,headers:r={},method:s="GET",bodyReadable:n,resWriter:a,socket:i=null}){return{req:new ad({url:t,headers:r,method:s,socket:i,readable:n}),res:new ap({socket:i,resWriter:a})}}class af{async load(t){return await require(t)}}class am{static async load(t,r=new af){let s=await r.load(t);if("routeModule"in s)return s.routeModule;throw Object.defineProperty(Error(`Module "${t}" does not export a routeModule.`),"__NEXT_ERROR_CODE",{value:"E53",enumerable:!1})}}let ah=(t,r)=>{let s=c().isAbsolute(r)?r:c().join(t,r);return(0,d.pathToFileURL)(s).toString()};function ay(t){var r,s;return(null==(s=t.has)?void 0:null==(r=s[0])?void 0:r.key)===tn}class ag{add(t){this.callbacks.push(t)}async runAll(){if(!this.callbacks.length)return;let t=this.callbacks;this.callbacks=[],await Promise.allSettled(t.map(async t=>t()))}constructor(){this.callbacks=[]}}let ab=new tf(5e7),aD=new Map,ax={async get(t,r){await aD.get(t);let s=ab.get(t);if(!s)return;let n=s.entry;if(performance.timeOrigin+performance.now()>n.timestamp+1e3*n.revalidate||(0,ar.isTagStale)(n.tags,n.timestamp)||(0,ar.isTagStale)(r,n.timestamp))return;let[a,i]=n.value.tee();return n.value=i,{...n,value:a}},async set(t,r){let s=()=>{},n=new Promise(t=>{s=t});aD.set(t,n);let a=await r,i=0;try{let[r,s]=a.value.tee();a.value=r;let n=s.getReader();for(let t;!(t=await n.read()).done;)i+=Buffer.from(t.value).byteLength;ab.set(t,{entry:a,isErrored:!1,errorRetryCount:0,size:i})}catch(r){console.error(`Error while saving cache key: ${t}`,r)}finally{s(),aD.delete(t)}},async unstable_expireTags(...t){for(let r of t)ar.tagsManifest.items[r]||(ar.tagsManifest.items[r]={}),ar.tagsManifest.items[r].revalidatedAt=Date.now()},async receiveExpiredTags(...t){return this.unstable_expireTags(...t)}},av=t=>import(t).then(t=>t.default||t),aE=require,aj=new WeakMap;function aA(t){let r=aj.get(t);if(r)return r;if(!Array.isArray(t.matchers))throw Object.defineProperty(Error(`Invariant: invalid matchers for middleware ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E257",enumerable:!1});let s=n6(t.matchers);return aj.set(t,s),s}class aS extends nR{constructor(t){super(t),this.registeredInstrumentation=!1,this.cleanupListeners=new ag,this.handleNextImageRequest=async(t,r,s)=>!!(s.pathname&&s.pathname.startsWith("/_next/image"))&&(r.statusCode=400,r.body("Bad Request").send(),!0),this.handleCatchallRenderRequest=async(t,r,s)=>{let{pathname:n,query:a}=s;if(!n)throw Object.defineProperty(Error("Invariant: pathname is undefined"),"__NEXT_ERROR_CODE",{value:"E409",enumerable:!1});a._nextBubbleNoFallback="1";try{var i;n=tL(n);let o={i18n:null==(i=this.i18nProvider)?void 0:i.fromQuery(n,a)},B=await this.matchers.match(n,o);if(!B)return await this.render(t,r,n,a,s,!0),!0;for(let n of(eA(t,"match",B),this.getEdgeFunctionsPages()))if(n===B.definition.page){if("export"===this.nextConfig.output)return await this.render404(t,r,s),!0;delete a._nextBubbleNoFallback,delete a[to];try{if(await this.runEdgeFunction({req:t,res:r,query:a,params:B.params,page:B.definition.page,match:B,appPaths:null}))return!0}catch(r){throw await this.instrumentationOnRequestError(r,t,{routePath:B.definition.page,routerKind:"Pages Router",routeType:"route",revalidateReason:void 0}),r}}if(au(B)){if("export"===this.nextConfig.output)return await this.render404(t,r,s),!0;if(delete a._nextBubbleNoFallback,await this.handleApiRequest(t,r,a,B))return!0}return await this.render(t,r,n,a,s,!0),!0}catch(s){if(s instanceof nk)throw s;try{return this.logError(s),r.statusCode=500,await this.renderError(s,t,r,n,a),!0}catch{}throw s}},this.handleCatchallMiddlewareRequest=async(t,r,s)=>{let n;let a=eE(t,"middlewareInvoke");if(!a)return!1;let i=()=>(eA(t,"middlewareInvoke",!0),r.body("").send(),!0),o=this.getMiddleware();if(!o)return i();let B=tC(eE(t,"initURL")),l=rf(B.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});B.pathname=l.pathname;let u=tL(s.pathname||"");if(!o.match(u,t,B.query))return i();let c=!1;try{if(await this.ensureMiddleware(t.url),n=await this.runMiddleware({request:t,response:r,parsedUrl:B,parsed:s}),"response"in n){if(a)throw c=!0,Object.defineProperty(new t0.BubbledError(!0,n),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1});for(let[t,s]of Object.entries(rr(n.response.headers)))"content-encoding"!==t&&void 0!==s&&r.setHeader(t,s);r.statusCode=n.response.status;let{originalResponse:t}=r;return n.response.body?await rL(n.response.body,t):t.end(),!0}}catch(a){if(c)throw a;if(sd(a)&&"ENOENT"===a.code)return await this.render404(t,r,s),!0;if(a instanceof ey)return r.statusCode=400,await this.renderError(a,t,r,s.pathname||""),!0;let n=sC(a);return console.error(n),r.statusCode=500,await this.renderError(n,t,r,s.pathname||""),!0}return n.finished},this.renderOpts.optimizeCss&&(process.env.__NEXT_OPTIMIZE_CSS=JSON.stringify(!0)),this.renderOpts.nextScriptWorkers&&(process.env.__NEXT_SCRIPT_WORKERS=JSON.stringify(!0)),process.env.NEXT_DEPLOYMENT_ID=this.nextConfig.deploymentId||"";let{appDocumentPreloading:r}=this.nextConfig.experimental,s=void 0===r;if(t.dev||!0!==r&&s||(n4({distDir:this.distDir,page:"/_document",isAppPath:!1}).catch(()=>{}),n4({distDir:this.distDir,page:"/_app",isAppPath:!1}).catch(()=>{})),t.dev,!t.dev){let{dynamicRoutes:t=[]}=this.getRoutesManifest()??{};this.dynamicRoutes=t.map(t=>{let r=tJ(t.page);return{match:ex(r),page:t.page,re:r.re}})}al(this.nextConfig),this.middlewareManifestPath=(0,u.join)(this.serverDistDir,eR),t.dev||this.prepare().catch(t=>{console.error("Failed to prepare server",t)})}async unstable_preloadEntries(){let t=this.getAppPathsManifest();for(let t of Object.keys(this.getPagesManifest()||{}))await n4({distDir:this.distDir,page:t,isAppPath:!1}).catch(()=>{});for(let r of Object.keys(t||{}))await n4({distDir:this.distDir,page:r,isAppPath:!0}).then(async({ComponentMod:t})=>{t.patchFetch();let r=t.__next_app__.require;if(null==r?void 0:r.m)for(let t of Object.keys(r.m))await r(t)}).catch(()=>{})}async handleUpgrade(){}async loadInstrumentationModule(){if(!this.serverOptions.dev)try{this.instrumentation=await aE((0,u.resolve)(this.serverOptions.dir||".",this.serverOptions.conf.distDir,"server",e7.Hw))}catch(t){if("MODULE_NOT_FOUND"!==t.code)throw Object.defineProperty(Error("An error occurred while loading the instrumentation hook",{cause:t}),"__NEXT_ERROR_CODE",{value:"E92",enumerable:!1})}return this.instrumentation}async prepareImpl(){await super.prepareImpl(),await this.runInstrumentationHookIfAvailable()}async runInstrumentationHookIfAvailable(){var t,r;this.registeredInstrumentation||(this.registeredInstrumentation=!0,await (null==(r=this.instrumentation)?void 0:null==(t=r.register)?void 0:t.call(r)))}loadEnvConfig({dev:t,forceReload:r,silent:s}){(0,n7.loadEnvConfig)(this.dir,t,s?{info:()=>{},error:()=>{}}:B,r)}async getIncrementalCache({requestHeaders:t,requestProtocol:r}){let s;let n=!1,{cacheHandler:a}=this.nextConfig;a&&(s=nX(await av(ah(this.distDir,a))));let{cacheHandlers:i}=this.nextConfig.experimental;if(!globalThis.__nextCacheHandlers&&i){for(let t of(globalThis.__nextCacheHandlers={},Object.keys(i)))i[t]&&(globalThis.__nextCacheHandlers[t]=nX(await av(ah(this.distDir,i[t]))));i.default||(globalThis.__nextCacheHandlers.default=ax)}return new ai({fs:this.getCacheFilesystem(),dev:n,requestHeaders:t,requestProtocol:r,dynamicIO:!!this.nextConfig.experimental.dynamicIO,allowedRevalidateHeaderKeys:this.nextConfig.experimental.allowedRevalidateHeaderKeys,minimalMode:!0,serverDistDir:this.serverDistDir,fetchCacheKeyPrefix:this.nextConfig.experimental.fetchCacheKeyPrefix,maxMemoryCacheSize:this.nextConfig.cacheMaxMemorySize,flushToDisk:!1,getPrerenderManifest:()=>this.getPrerenderManifest(),CurCacheHandler:s})}getResponseCache(){return new rQ(!0)}getPublicDir(){return(0,u.join)(this.dir,eJ)}getHasStaticDir(){return f().existsSync((0,u.join)(this.dir,"static"))}getPagesManifest(){return nK((0,u.join)(this.serverDistDir,eI))}getAppPathsManifest(){if(this.enabledDirectories.app)return nK((0,u.join)(this.serverDistDir,eT))}getinterceptionRoutePatterns(){if(!this.enabledDirectories.app)return[];let t=this.getRoutesManifest();return(null==t?void 0:t.rewrites.beforeFiles.filter(ay).map(t=>new RegExp(t.regex)))??[]}async hasPage(t){var r;return!!nW(t,this.distDir,null==(r=this.nextConfig.i18n)?void 0:r.locales,this.enabledDirectories.app)}getBuildId(){let t=(0,u.join)(this.distDir,eG);try{return f().readFileSync(t,"utf8").trim()}catch(t){if("ENOENT"===t.code)throw Object.defineProperty(Error(`Could not find a production build in the '${this.distDir}' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id`),"__NEXT_ERROR_CODE",{value:"E427",enumerable:!1});throw t}}getEnabledDirectories(t){let r=t?this.dir:this.serverDistDir;return{app:!!eX(r,"app"),pages:!!eX(r,"pages")}}sendRenderResult(t,r,s){return tc({req:t.originalRequest,res:r.originalResponse,result:s.result,type:s.type,generateEtags:s.generateEtags,poweredByHeader:s.poweredByHeader,revalidate:s.revalidate,expireTime:s.expireTime})}async runApi(t,r,s,n){for(let a of this.getEdgeFunctionsPages())if(a===n.definition.pathname&&await this.runEdgeFunction({req:t,res:r,query:s,params:n.params,page:n.definition.pathname,appPaths:null}))return!0;let a=await am.load(n.definition.filename);return s={...s,...n.params},delete s.__nextLocale,delete s.__nextDefaultLocale,delete s.__nextInferredLocaleFromDefault,await a.render(t.originalRequest,r.originalResponse,{previewProps:this.renderOpts.previewProps,revalidate:this.revalidate.bind(this),trustHostHeader:this.nextConfig.experimental.trustHostHeader,allowedRevalidateHeaderKeys:this.nextConfig.experimental.allowedRevalidateHeaderKeys,hostname:this.fetchHostname,minimalMode:!0,dev:!1,query:s,params:n.params,page:n.definition.pathname,onError:this.instrumentationOnRequestError.bind(this),multiZoneDraftMode:this.nextConfig.experimental.multiZoneDraftMode}),!0}async renderHTML(t,r,s,n,a){return(0,t0.getTracer)().trace(t2.Fx.renderHTML,async()=>this.renderHTMLImpl(t,r,s,n,a))}async renderHTMLImpl(t,r,s,n,a){throw Object.defineProperty(Error("Invariant: renderHTML should not be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E472",enumerable:!1})}async imageOptimizer(t,r,s,n){throw Object.defineProperty(Error("invariant: imageOptimizer should not be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E506",enumerable:!1})}getPagePath(t,r){return nV(t,this.distDir,r,this.enabledDirectories.app)}async renderPageComponent(t,r){let s=this.getEdgeFunctionsPages()||[];if(s.length){let r=this.getOriginalAppPaths(t.pathname),n=Array.isArray(r),a=t.pathname;for(let i of(n&&(a=r[0]),s))if(i===a)return await this.runEdgeFunction({req:t.req,res:t.res,query:t.query,params:t.renderOpts.params,page:a,appPaths:r}),null}return super.renderPageComponent(t,r)}async findPageComponents({page:t,query:r,params:s,isAppPath:n,url:a}){return(0,t0.getTracer)().trace(t2.Fx.findPageComponents,{spanName:"resolve page components",attributes:{"next.route":n?tO(t):t}},()=>this.findPageComponentsImpl({page:t,query:r,params:s,isAppPath:n,url:a}))}async findPageComponentsImpl({page:t,query:r,params:s,isAppPath:n,url:a}){let i=[t];for(let a of(r.amp&&i.unshift((n?tO(t):sA(t))+".amp"),r.__nextLocale&&i.unshift(...i.map(t=>`/${r.__nextLocale}${"/"===t?"":t}`)),i))try{let t=await n4({distDir:this.distDir,page:a,isAppPath:n});if(r.__nextLocale&&"string"==typeof t.Component&&!a.startsWith(`/${r.__nextLocale}`))continue;return{components:t,query:{...!this.renderOpts.isExperimentalCompile&&t.getStaticProps?{amp:r.amp,__nextDataReq:r.__nextDataReq,__nextLocale:r.__nextLocale,__nextDefaultLocale:r.__nextDefaultLocale}:r,...(n?{}:s)||{}}}}catch(t){if(!(t instanceof eb))throw t}return null}getNextFontManifest(){return nK((0,u.join)(this.distDir,"server",eF+".json"))}logErrorWithOriginalStack(t,r){throw Object.defineProperty(Error("Invariant: logErrorWithOriginalStack can only be called on the development server"),"__NEXT_ERROR_CODE",{value:"E6",enumerable:!1})}async ensurePage(t){throw Object.defineProperty(Error("Invariant: ensurePage can only be called on the development server"),"__NEXT_ERROR_CODE",{value:"E291",enumerable:!1})}async handleApiRequest(t,r,s,n){return this.runApi(t,r,s,n)}getCacheFilesystem(){return ac}normalizeReq(t){return t instanceof e0?t:new e0(t)}normalizeRes(t){return t instanceof e2?t:new e2(t)}getRequestHandler(){return this.makeRequestHandler()}makeRequestHandler(){this.prepare().catch(t=>{console.error("Failed to prepare server",t)});let t=super.getRequestHandler();return(r,s,n)=>t(this.normalizeReq(r),this.normalizeRes(s),n)}async revalidate({urlPath:t,revalidateHeaders:r,opts:s}){let n=aC({url:t,headers:r}),a=this.getRequestHandler();if(await a(new e0(n.req),new e2(n.res)),await n.res.hasStreamed,"REVALIDATED"!==n.res.getHeader("x-nextjs-cache")&&!(404===n.res.statusCode&&s.unstable_onlyGenerated))throw Object.defineProperty(Error(`Invalid response ${n.res.statusCode}`),"__NEXT_ERROR_CODE",{value:"E175",enumerable:!1})}async render(t,r,s,n,a,i=!1){return super.render(this.normalizeReq(t),this.normalizeRes(r),s,n,a,i)}async renderToHTML(t,r,s,n){return super.renderToHTML(this.normalizeReq(t),this.normalizeRes(r),s,n)}async renderErrorToResponseImpl(t,r){let{req:s,res:n,query:a}=t;return 404===n.statusCode&&this.enabledDirectories.app&&this.getEdgeFunctionsPages().includes(ew)?(await this.runEdgeFunction({req:s,res:n,query:a||{},params:{},page:ew,appPaths:null}),null):super.renderErrorToResponseImpl(t,r)}async renderError(t,r,s,n,a,i){return super.renderError(t,this.normalizeReq(r),this.normalizeRes(s),n,a,i)}async renderErrorToHTML(t,r,s,n,a){return super.renderErrorToHTML(t,this.normalizeReq(r),this.normalizeRes(s),n,a)}async render404(t,r,s,n){return super.render404(this.normalizeReq(t),this.normalizeRes(r),s,n)}getMiddlewareManifest(){return null}getMiddleware(){var t;let r=this.getMiddlewareManifest(),s=null==r?void 0:null==(t=r.middleware)?void 0:t["/"];if(s)return{match:aA(s),page:"/"}}getEdgeFunctionsPages(){let t=this.getMiddlewareManifest();return t?Object.keys(t.functions):[]}getEdgeFunctionInfo(t){let r;let s=this.getMiddlewareManifest();if(!s)return null;try{r=r7(sA(t.page))}catch(t){return null}let n=t.middleware?s.middleware[r]:s.functions[r];if(!n){if(!t.middleware)throw new eb(r);return null}return{name:n.name,paths:n.files.map(t=>(0,u.join)(this.distDir,t)),wasm:(n.wasm??[]).map(t=>({...t,filePath:(0,u.join)(this.distDir,t.filePath)})),assets:n.assets&&n.assets.map(t=>({...t,filePath:(0,u.join)(this.distDir,t.filePath)})),env:n.env}}async hasMiddleware(t){let r=this.getEdgeFunctionInfo({page:t,middleware:!0});return!!(r&&r.paths.length>0)}async ensureMiddleware(t){}async ensureEdgeFunction(t){}async runMiddleware(t){throw Object.defineProperty(Error("invariant: runMiddleware should not be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E276",enumerable:!1})}getPrerenderManifest(){var t,r;return this._cachedPreviewManifest||((t=this.renderOpts,(null==(r=this.serverOptions)?void 0:r.dev)||process.env.NEXT_PHASE===eO)?this._cachedPreviewManifest={version:4,routes:{},dynamicRoutes:{},notFoundRoutes:[],preview:{previewModeId:__webpack_require__("crypto").randomBytes(16).toString("hex"),previewModeSigningKey:__webpack_require__("crypto").randomBytes(32).toString("hex"),previewModeEncryptionKey:__webpack_require__("crypto").randomBytes(32).toString("hex")}}:this._cachedPreviewManifest=nK((0,u.join)(this.distDir,ek))),this._cachedPreviewManifest}getRoutesManifest(){return(0,t0.getTracer)().trace(t2.Fx.getRoutesManifest,()=>{let t=nK((0,u.join)(this.distDir,eM)),r=t.rewrites??{beforeFiles:[],afterFiles:[],fallback:[]};return Array.isArray(r)&&(r={beforeFiles:[],afterFiles:r,fallback:[]}),{...t,rewrites:r}})}attachRequestMeta(t,r,s){var n;let a=(null==(n=t.headers["x-forwarded-proto"])?void 0:n.includes("https"))?"https":"http",i=this.fetchHostname&&this.port?`${a}://${this.fetchHostname}:${this.port}${t.url}`:this.nextConfig.experimental.trustHostHeader?`https://${t.headers.host||"localhost"}${t.url}`:t.url;eA(t,"initURL",i),eA(t,"initQuery",{...r.query}),eA(t,"initProtocol",a),s||eA(t,"clonableBody",at(t.originalRequest))}async runEdgeFunction(t){throw Object.defineProperty(Error("Middleware is not supported in minimal mode. Please remove the `NEXT_MINIMAL` environment variable."),"__NEXT_ERROR_CODE",{value:"E58",enumerable:!1})}get serverDistDir(){if(this._serverDistDir)return this._serverDistDir;let t=(0,u.join)(this.distDir,eH);return this._serverDistDir=t,t}async getFallbackErrorComponents(t){return null}async instrumentationOnRequestError(...t){await super.instrumentationOnRequestError(...t),this.logError(t[0])}onServerClose(t){this.cleanupListeners.add(t)}async close(){await this.cleanupListeners.runAll()}getInternalWaitUntil(){return this.internalWaitUntil??=this.createInternalWaitUntil(),this.internalWaitUntil}createInternalWaitUntil(){throw Object.defineProperty(new er("createInternalWaitUntil should never be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E540",enumerable:!1})}}})(),module.exports=__webpack_exports__})();
|
|
2872
|
+
see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1});if(null==t?void 0:t.stack){let s=t.stack;r.stack=r.message+s.substring(s.indexOf("\n"))}throw r}return"isNotFound"in h&&h.isNotFound?{value:null,revalidate:h.revalidate,isFallback:!1}:h.isRedirect?{value:{kind:tY.REDIRECT,props:h.pageData??h.flightData},revalidate:h.revalidate,isFallback:!1}:l.isNull?null:j?{value:{kind:tY.APP_PAGE,html:l,headers:y,rscData:h.flightData,postponed:h.postponed,status:r.statusCode,segmentData:h.segmentData},revalidate:h.revalidate,isFallback:!!B}:{value:{kind:tY.PAGES,html:l,pageData:h.pageData??h.flightData,headers:y,status:j?r.statusCode:void 0},revalidate:h.revalidate,isFallback:"true"===i.__nextFallback}},ei=async({hasResolved:o,previousCacheEntry:B,isRevalidating:l})=>{if(o||r.sent,!y&&N){if(S){let r=await this.getStaticPaths({pathname:s,requestHeaders:t.headers,isAppPath:j,page:a.page});y=r.staticPaths,g=r.fallbackMode}else y=void 0,g=nN.NOT_FOUND}g===nN.PRERENDER&&r4(t.headers["user-agent"]||"")&&(g=nN.BLOCKING_STATIC_RENDER),(null==B?void 0:B.isStale)===-1&&($=!0),$&&(g!==nN.NOT_FOUND||B)&&(g=nN.BLOCKING_STATIC_RENDER);let u=er;!u&&n.dev&&j&&(u=s9(I)),u&&i.amp&&(u=u.replace(/\.amp$/,"")),u&&(null==y||y.includes(u)),this.nextConfig.experimental.isExperimentalCompile&&(g=nN.BLOCKING_STATIC_RENDER);let c=$||l||!W?void 0:W;if((J||U)&&void 0!==c)return{revalidate:1,isFallback:!1,value:{kind:tY.PAGES,html:rH.fromStatic(""),pageData:{},headers:void 0,status:void 0}};let d=N&&K&&(eE(t,"didSetDefaultRouteMatches")||Q)?tX(s):null,p=await ea({postponed:c,fallbackRouteParams:d});return p?{...p,revalidate:p.revalidate}:null},eo=await this.responseCache.get(er,ei,{routeKind:(null==b?void 0:b.definition.kind)??(j?rG.APP_PAGE:rG.PAGES),incrementalCache:en,isOnDemandRevalidate:$,isPrefetch:"prefetch"===t.headers.purpose,isRoutePPREnabled:K});if(K&&"string"==typeof q){if(r.setHeader(tB,"2"),null!==eo&&(null==(C=eo.value)?void 0:C.kind)===tY.APP_PAGE&&eo.value.segmentData){let t=eo.value.segmentData.get(q);if(void 0!==t)return{type:"rsc",body:rH.fromStatic(t),revalidate:eo.revalidate}}return r.statusCode=204,{type:"rsc",body:rH.fromStatic(""),revalidate:null==eo?void 0:eo.revalidate}}if(Z&&r.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),!eo){if(er&&!($&&ee))throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1});return null}let eB=(null==(c=eo.value)?void 0:c.kind)===tY.APP_PAGE&&"string"==typeof eo.value.postponed;w&&!V&&(!eB||M)&&r.setHeader(tl,"1");let{value:el}=eo;if((null==el?void 0:el.kind)===tY.IMAGE)throw Object.defineProperty(Error("invariant SSG should not return an image cache value"),"__NEXT_ERROR_CODE",{value:"E390",enumerable:!1});if(W)D=0;else if(R&&!M&&K)D=0;else if(1){if(Z)D=0;else if(w){if(v){let r=eE(t,"notFoundRevalidate");D=void 0===r?0:r}else if(E)D=0;else if("number"==typeof eo.revalidate){if(eo.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${eo.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1});D=eo.revalidate}else!1===eo.revalidate&&(D=e7.qF)}else r.getHeader("Cache-Control")||(D=0)}eo.revalidate=D;let eu=eE(t,"onCacheEntry");if(eu&&await eu({...eo,value:{...eo.value,kind:(null==(f=eo.value)?void 0:f.kind)===tY.APP_PAGE?"PAGE":null==(m=eo.value)?void 0:m.kind}},{url:eE(t,"initURL")}))return null;if(el){if(el.kind===tY.REDIRECT)return(void 0===eo.revalidate||r.getHeader("Cache-Control")||r.setHeader("Cache-Control",e9({revalidate:eo.revalidate,expireTime:this.nextConfig.expireTime})),k)?{type:"json",body:rH.fromStatic(JSON.stringify(el.props)),revalidate:eo.revalidate}:(await et(el.props),null);if(el.kind===tY.APP_ROUTE){let s=re(el.headers);return w||s.delete(e7.VC),void 0===eo.revalidate||r.getHeader("Cache-Control")||s.get("Cache-Control")||s.set("Cache-Control",e9({revalidate:eo.revalidate,expireTime:this.nextConfig.expireTime})),await s3(t,r,new Response(el.body,{headers:s,status:el.status||200})),null}if(el.kind===tY.APP_PAGE){if(eB&&W)throw Object.defineProperty(Error("Invariant: postponed state should not be present on a resume request"),"__NEXT_ERROR_CODE",{value:"E396",enumerable:!1});if(el.headers){let t={...el.headers};for(let[s,n]of(w||delete t[e7.VC],Object.entries(t)))if(void 0!==n){if(Array.isArray(n))for(let t of n)r.appendHeader(s,t);else"number"==typeof n&&(n=n.toString()),r.appendHeader(s,n)}}if(w&&(null==(h=el.headers)?void 0:h[e7.VC])&&r.setHeader(e7.VC,el.headers[e7.VC]),!el.status||R&&K||(r.statusCode=el.status),eB&&r.setHeader(tB,"1"),R&&!Z){if(void 0===el.rscData){if(el.postponed)throw Object.defineProperty(Error("Invariant: Expected postponed to be undefined"),"__NEXT_ERROR_CODE",{value:"E372",enumerable:!1});return{type:"rsc",body:el.html,revalidate:V?0:eo.revalidate}}return{type:"rsc",body:rH.fromStatic(el.rscData),revalidate:eo.revalidate}}return{type:"html",body:el.html,revalidate:eo.revalidate}}return k?{type:"json",body:rH.fromStatic(JSON.stringify(el.pageData)),revalidate:eo.revalidate}:{type:"html",body:el.html,revalidate:eo.revalidate}}return(eA(t,"notFoundRevalidate",eo.revalidate),void 0===eo.revalidate||r.getHeader("Cache-Control")||r.setHeader("Cache-Control",e9({revalidate:eo.revalidate,expireTime:this.nextConfig.expireTime})),k)?(r.statusCode=404,r.body('{"notFound":true}').send()):await this.render404(t,r,{pathname:s,query:i},!1),null}stripNextDataPath(t,r=!0){return(t.includes(this.buildId)&&(t=r7(t.substring(t.indexOf(this.buildId)+this.buildId.length).replace(/\.json$/,""))),this.localeNormalizer&&r)?this.localeNormalizer.normalize(t):t}getOriginalAppPaths(t){if(this.enabledDirectories.app){var r;return(null==(r=this.appPathRoutes)?void 0:r[t])||null}return null}async renderPageComponent(t,r){var s;let{query:n,pathname:a}=t,i=this.getOriginalAppPaths(a),o=Array.isArray(i),B=a;o&&(B=i[i.length-1]);let l=await this.findPageComponents({page:B,query:n,params:t.renderOpts.params||{},isAppPath:o,sriEnabled:!!(null==(s=this.nextConfig.experimental.sri)?void 0:s.algorithm),appPaths:i,shouldEnsure:!1});if(l){(0,t0.getTracer)().setRootSpanAttribute("next.route",a);try{return await this.renderToResponseWithComponents(t,l)}catch(s){let t=s instanceof nk;if(!t||t&&r)throw s}}return!1}async renderToResponse(t){return(0,t0.getTracer)().trace(t2.Li.renderToResponse,{spanName:"rendering page",attributes:{"next.route":t.pathname}},async()=>this.renderToResponseImpl(t))}async renderToResponseImpl(t){var r;let{res:s,query:n,pathname:a}=t,i=a,o=!!n._nextBubbleNoFallback;delete n[to],delete n._nextBubbleNoFallback;let B={i18n:null==(r=this.i18nProvider)?void 0:r.fromQuery(a,n)};try{for await(let r of this.matchers.matchAll(a,B)){eE(t.req,"invokeOutput");let s=await this.renderPageComponent({...t,pathname:r.definition.pathname,renderOpts:{...t.renderOpts,params:r.params}},o);if(!1!==s)return s}if(this.serverOptions.webServerConfig){t.pathname=this.serverOptions.webServerConfig.page;let r=await this.renderPageComponent(t,o);if(!1!==r)return r}}catch(a){let r=sC(a);if(a instanceof eD)throw console.error("Invariant: failed to load static page",JSON.stringify({page:i,url:t.req.url,matchedPath:t.req.headers[e7.vx],initUrl:eE(t.req,"initURL"),didRewrite:!!eE(t.req,"rewroteURL"),rewroteUrl:eE(t.req,"rewroteURL")},null,2)),r;if(r instanceof nk&&o)throw r;if(r instanceof ey||r instanceof eg)return s.statusCode=400,await this.renderErrorToResponse(t,r);s.statusCode=500,await this.hasPage("/500")&&(t.query.__nextCustomErrorRender="1",await this.renderErrorToResponse(t,r),delete t.query.__nextCustomErrorRender);let n=r instanceof nM;if(!n)throw sd(r)&&(r.page=i),r;return await this.renderErrorToResponse(t,n?r.innerError:r)}return this.getMiddleware()&&t.req.headers["x-nextjs-data"]&&(!s.statusCode||200===s.statusCode||404===s.statusCode)?(s.setHeader("x-nextjs-matched-path",`${n.__nextLocale?`/${n.__nextLocale}`:""}${a}`),s.statusCode=200,s.setHeader("content-type","application/json"),s.body("{}"),s.send(),null):(s.statusCode=404,this.renderErrorToResponse(t,null))}async renderToHTML(t,r,s,n={}){return(0,t0.getTracer)().trace(t2.Li.renderToHTML,async()=>this.renderToHTMLImpl(t,r,s,n))}async renderToHTMLImpl(t,r,s,n={}){return this.getStaticHTML(t=>this.renderToResponse(t),{req:t,res:r,pathname:s,query:n})}async renderError(t,r,s,n,a={},i=!0){return(0,t0.getTracer)().trace(t2.Li.renderError,async()=>this.renderErrorImpl(t,r,s,n,a,i))}async renderErrorImpl(t,r,s,n,a={},i=!0){return i&&s.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),this.pipe(async r=>{let n=await this.renderErrorToResponse(r,t);if(500===s.statusCode)throw t;return n},{req:r,res:s,pathname:n,query:a})}async renderErrorToResponse(t,r){return(0,t0.getTracer)().trace(t2.Li.renderErrorToResponse,async()=>this.renderErrorToResponseImpl(t,r))}async renderErrorToResponseImpl(t,r){let{res:s,query:n}=t;try{let a=null,i=404===s.statusCode,o=!1;i&&(this.enabledDirectories.app&&(a=await this.findPageComponents({page:ew,query:n,params:{},isAppPath:!0,shouldEnsure:!0,url:t.req.url}),o=null!==a),!a&&await this.hasPage("/404")&&(a=await this.findPageComponents({page:"/404",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:t.req.url}),o=null!==a));let B=`/${s.statusCode}`;if(!t.query.__nextCustomErrorRender&&!a&&eq.includes(B)&&(a=await this.findPageComponents({page:B,query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:t.req.url})),a||(a=await this.findPageComponents({page:"/_error",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:t.req.url}),B="/_error"),!a)throw new nM(Object.defineProperty(Error("missing required error components"),"__NEXT_ERROR_CODE",{value:"E60",enumerable:!1}));a.components.routeModule?eA(t.req,"match",{definition:a.components.routeModule.definition,params:void 0}):eS(t.req,"match");try{return await this.renderToResponseWithComponents({...t,pathname:B,renderOpts:{...t.renderOpts,err:r}},a)}catch(t){if(t instanceof nk)throw Object.defineProperty(Error("invariant: failed to render error page"),"__NEXT_ERROR_CODE",{value:"E55",enumerable:!1});throw t}}catch(o){let r=sC(o),a=r instanceof nM;a||this.logError(r),s.statusCode=500;let i=await this.getFallbackErrorComponents(t.req.url);if(i)return eA(t.req,"match",{definition:i.routeModule.definition,params:void 0}),this.renderToResponseWithComponents({...t,pathname:"/_error",renderOpts:{...t.renderOpts,err:a?r.innerError:r}},{query:n,components:i});return{type:"html",body:rH.fromStatic("Internal Server Error")}}}async renderErrorToHTML(t,r,s,n,a={}){return this.getStaticHTML(r=>this.renderErrorToResponse(r,t),{req:r,res:s,pathname:n,query:a})}async render404(t,r,s,n=!0){let{pathname:a,query:i}=s||(0,d.parse)(t.url,!0);return this.nextConfig.i18n&&(i.__nextLocale||=this.nextConfig.i18n.defaultLocale,i.__nextDefaultLocale||=this.nextConfig.i18n.defaultLocale),r.statusCode=404,this.renderError(null,t,r,a,i,n)}}let nL=require("vm");function nH(t){if(Object.isFrozen(t))return t;if(Array.isArray(t)){for(let r of t)r&&"object"==typeof r&&nH(r);return Object.freeze(t)}for(let r of Object.values(t))r&&"object"==typeof r&&nH(r);return Object.freeze(t)}let nG=new Map;function nK(t,r=!0,s=nG){let n=r&&s.get(t);if(n)return n;let a=JSON.parse((0,C.readFileSync)(t,"utf8"));return r&&(a=nH(a)),r&&s.set(t,a),a}function nJ(t,r=!0,s=nG){let n=r&&s.get(t);if(n)return n;let a=(0,C.readFileSync)(t,"utf8");if(0===a.length)throw Object.defineProperty(Error("Manifest file is empty"),"__NEXT_ERROR_CODE",{value:"E328",enumerable:!1});let i={};return(0,nL.runInNewContext)(a,i),r&&(i=nH(i)),r&&s.set(t,i),i}let nU=!1,nQ=new tf(1e3);function nW(t,r,s,n){let a;let i=`${t}:${r}:${s}:${n}`,o=null==nQ?void 0:nQ.get(i);if(o)return o;let B=c().join(r,eH);n&&(a=nK(c().join(B,eT),!nU));let l=nK(c().join(B,eI),!nU);try{t=r7(sA(t))}catch(r){throw console.error(r),new eb(t)}let u=r=>{let n=r[t];if(!r[n]&&s){let a={};for(let t of Object.keys(r))a[rp(t,s).pathname]=l[t];n=a[t]}return n};return(a&&(o=u(a)),o||(o=u(l)),o)?(o=c().join(B,o),null==nQ||nQ.set(i,o),o):(null==nQ||nQ.set(i,null),null)}function nV(t,r,s,n){let a=nW(t,r,s,n);if(!a)throw new eb(t);return a}async function nq(t,r,s){let n=nV(t,r,void 0,s);if(n.endsWith(".html"))return C.promises.readFile(n,"utf8").catch(r=>{throw new eD(t,r.message)});try{return process.env.__NEXT_PRIVATE_RUNTIME_TYPE=s?"app":"pages",require(n)}finally{process.env.__NEXT_PRIVATE_RUNTIME_TYPE=""}}function nX(t){return t.default||t}async function nY(t){return new Promise(r=>setTimeout(r,t))}let nz=Symbol.for("next.server.action-manifests");function nZ({page:t,clientReferenceManifest:r,serverActionsManifest:s,serverModuleMap:n}){var a;let i=null==(a=globalThis[nz])?void 0:a.clientReferenceManifestsPerPage;globalThis[nz]={clientReferenceManifestsPerPage:{...i,[tO(t)]:r},serverActionsManifest:s,serverModuleMap:n}}function n$({serverActionsManifest:t}){return new Proxy({},{get:(r,s)=>{let n;let a=t.node[s].workers,i=W.workAsyncStorage.getStore();if(!(n=i?a[n1(i.page)]:Object.values(a).at(0)))return;let{moduleId:o,async:B}=n;return{id:o,name:s,chunks:[],async:B}}})}function n1(t){return rl(t,"app")?t:"app"+t}async function n0(t,r=3){for(;;)try{return nK(t)}catch(t){if(--r<=0)throw t;await nY(100)}}async function n2(t,r=3){for(;;)try{return nJ(t)}catch(t){if(--r<=0)throw t;await nY(100)}}async function n3(t,r,s){try{return(await n2(t,s)).__RSC_MANIFEST[r]}catch(t){return}}async function n5({distDir:t,page:r,isAppPath:s,isDev:n}){let a={},i={};s||([a,i]=await Promise.all([nq("/_document",t,!1),nq("/_app",t,!1)]));let o=s&&!sT(r),B=n?3:1,[l,c,d,p,C]=await Promise.all([n0((0,u.join)(t,eN),B),n0((0,u.join)(t,eL),B),s?void 0:n0((0,u.join)(t,`${eV}.json`),B).catch(()=>void 0),o?n3((0,u.join)(t,"server","app",r.replace(/%5F/g,"_")+"_"+eQ+".js"),r.replace(/%5F/g,"_"),B):void 0,s?n0((0,u.join)(t,"server",eW+".json"),B).catch(()=>null):null]);C&&p&&nZ({page:r,clientReferenceManifest:p,serverActionsManifest:C,serverModuleMap:n$({serverActionsManifest:C})});let f=await nq(r,t,s),m=nX(f),h=nX(a),y=nX(i),{getServerSideProps:g,getStaticProps:b,getStaticPaths:D,routeModule:x}=f;return{App:y,Document:h,Component:m,buildManifest:l,reactLoadableManifest:c,dynamicCssManifest:d,pageConfig:f.config||{},ComponentMod:f,getServerSideProps:g,getStaticProps:b,getStaticPaths:D,clientReferenceManifest:p,serverActionsManifest:C,isAppPath:s,page:r,routeModule:x}}let n4=(0,t0.getTracer)().wrap(t2.p2.loadComponents,n5);function n6(t){return(r,s,n)=>{for(let a of t)if(new RegExp(a.regexp).exec(r)&&(!a.has&&!a.missing||ss(s,n,a.has,a.missing)))return!0;return!1}}var n7=__webpack_require__("../next-env/dist/index.js");let n9=require("stream");var n8=/*#__PURE__*/__webpack_require__.n(n9);function ae(t,r){for(let s in r){let n=r[s];"function"==typeof n&&(n=n.bind(t)),t[s]=n}return t}function at(t){let r=null,s=new Promise((r,s)=>{t.on("end",r),t.on("error",s)}).catch(t=>({error:t}));return{async finalize(){if(r){let n=await s;if(n&&"object"==typeof n&&n.error)throw n.error;ae(t,r),r=t}},cloneBodyStream(){let s=r??t,n=new n9.PassThrough,a=new n9.PassThrough;return s.on("data",t=>{n.push(t),a.push(t)}),s.on("end",()=>{n.push(null),a.push(null)}),r=a,n}}}let ar=require("next/dist/server/lib/incremental-cache/tags-manifest.external.js");class as{constructor(t){this.fs=t.fs,this.flushToDisk=t.flushToDisk,this.serverDistDir=t.serverDistDir,this.revalidatedTags=t.revalidatedTags,this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE,t.maxMemoryCacheSize?s||(this.debug&&console.log("using memory store for fetch cache"),s=new tf(t.maxMemoryCacheSize,function({value:t}){var r;if(!t)return 25;if(t.kind===tY.REDIRECT)return JSON.stringify(t.props).length;if(t.kind===tY.IMAGE)throw Object.defineProperty(Error("invariant image should not be incremental-cache"),"__NEXT_ERROR_CODE",{value:"E501",enumerable:!1});return t.kind===tY.FETCH?JSON.stringify(t.data||"").length:t.kind===tY.APP_ROUTE?t.body.length:t.html.length+((null==(r=JSON.stringify(t.kind===tY.APP_PAGE?t.rscData:t.pageData))?void 0:r.length)||0)})):this.debug&&console.log("not using memory store for fetch cache")}resetRequestCache(){}async revalidateTag(...t){let[r]=t;if(r="string"==typeof r?[r]:r,this.debug&&console.log("revalidateTag",r),0!==r.length)for(let t of r){let r=ar.tagsManifest.items[t]||{};r.revalidatedAt=Date.now(),ar.tagsManifest.items[t]=r}}async get(...t){var r,n,a,i,o,B;let[l,u]=t,{tags:c,softTags:d,kind:p,isRoutePPREnabled:C,isFallback:f}=u,m=null==s?void 0:s.get(l);if(this.debug&&console.log("get",l,c,p,!!m),!m){if(p===tz.APP_ROUTE)try{let t=this.getFilePath(`${l}.body`,tz.APP_ROUTE),r=await this.fs.readFile(t),{mtime:s}=await this.fs.stat(t),n=JSON.parse(await this.fs.readFile(t.replace(/\.body$/,e7.EP),"utf8"));return{lastModified:s.getTime(),value:{kind:tY.APP_ROUTE,body:r,headers:n.headers,status:n.status}}}catch{return null}try{let t=this.getFilePath(p===tz.FETCH?l:`${l}.html`,p),r=await this.fs.readFile(t,"utf8"),{mtime:n}=await this.fs.stat(t);if(p===tz.FETCH){if(!this.flushToDisk)return null;let t=n.getTime(),s=JSON.parse(r);if(m={lastModified:t,value:s},(null==(i=m.value)?void 0:i.kind)===tY.FETCH){let t=null==(o=m.value)?void 0:o.tags;(null==c?void 0:c.every(r=>null==t?void 0:t.includes(r)))||(this.debug&&console.log("tags vs storedTags mismatch",c,t),await this.set(l,m.value,{tags:c,isRoutePPREnabled:C}))}}else if(p===tz.APP_PAGE){let s,a,i;try{s=JSON.parse(await this.fs.readFile(t.replace(/\.html$/,e7.EP),"utf8"))}catch{}if(null==s?void 0:s.segmentPaths){let t=new Map;a=t;let r=l+e7.mH;await Promise.all(s.segmentPaths.map(async s=>{let n=this.getFilePath("/"===s?r+"/_index"+e7.tz:r+s+e7.tz,tz.APP_PAGE);try{t.set(s,await this.fs.readFile(n))}catch{}}))}f||(i=await this.fs.readFile(this.getFilePath(`${l}${C?e7.pu:e7.RM}`,tz.APP_PAGE))),m={lastModified:n.getTime(),value:{kind:tY.APP_PAGE,html:r,rscData:i,postponed:null==s?void 0:s.postponed,headers:null==s?void 0:s.headers,status:null==s?void 0:s.status,segmentData:a}}}else if(p===tz.PAGES){let t;let s={};f||(s=JSON.parse(await this.fs.readFile(this.getFilePath(`${l}${e7.x3}`,tz.PAGES),"utf8"))),m={lastModified:n.getTime(),value:{kind:tY.PAGES,html:r,pageData:s,headers:null==t?void 0:t.headers,status:null==t?void 0:t.status}}}else throw Object.defineProperty(Error(`Invariant: Unexpected route kind ${p} in file system cache.`),"__NEXT_ERROR_CODE",{value:"E445",enumerable:!1});m&&(null==s||s.set(l,m))}catch{return null}}if((null==m?void 0:null==(r=m.value)?void 0:r.kind)===tY.APP_PAGE||(null==m?void 0:null==(n=m.value)?void 0:n.kind)===tY.PAGES){let t;let r=null==(B=m.value.headers)?void 0:B[e7.VC];if("string"==typeof r&&(t=r.split(",")),(null==t?void 0:t.length)&&t.some(t=>{var r;return(null==ar.tagsManifest?void 0:null==(r=ar.tagsManifest.items[t])?void 0:r.revalidatedAt)&&(null==ar.tagsManifest?void 0:ar.tagsManifest.items[t].revalidatedAt)>=((null==m?void 0:m.lastModified)||Date.now())}))return null}else(null==m?void 0:null==(a=m.value)?void 0:a.kind)===tY.FETCH&&[...c||[],...d||[]].some(t=>{var r;return!!this.revalidatedTags.includes(t)||(null==ar.tagsManifest?void 0:null==(r=ar.tagsManifest.items[t])?void 0:r.revalidatedAt)&&(null==ar.tagsManifest?void 0:ar.tagsManifest.items[t].revalidatedAt)>=((null==m?void 0:m.lastModified)||Date.now())})&&(m=void 0);return m??null}async set(...t){let[r,n,a]=t,{isFallback:i}=a;if(null==s||s.set(r,{value:n,lastModified:Date.now()}),this.debug&&console.log("set",r),this.flushToDisk&&n){if(n.kind===tY.APP_ROUTE){let t=this.getFilePath(`${r}.body`,tz.APP_ROUTE);await this.fs.mkdir(sE().dirname(t)),await this.fs.writeFile(t,n.body);let s={headers:n.headers,status:n.status,postponed:void 0,segmentPaths:void 0};await this.fs.writeFile(t.replace(/\.body$/,e7.EP),JSON.stringify(s,null,2))}else if(n.kind===tY.PAGES||n.kind===tY.APP_PAGE){let t=n.kind===tY.APP_PAGE,s=this.getFilePath(`${r}.html`,t?tz.APP_PAGE:tz.PAGES);if(await this.fs.mkdir(sE().dirname(s)),await this.fs.writeFile(s,n.html),i||await this.fs.writeFile(this.getFilePath(`${r}${t?a.isRoutePPREnabled?e7.pu:e7.RM:e7.x3}`,t?tz.APP_PAGE:tz.PAGES),t?n.rscData:JSON.stringify(n.pageData)),(null==n?void 0:n.kind)===tY.APP_PAGE){let t={headers:n.headers,status:n.status,postponed:n.postponed,segmentPaths:void 0};await this.fs.writeFile(s.replace(/\.html$/,e7.EP),JSON.stringify(t))}}else if(n.kind===tY.FETCH){let t=this.getFilePath(r,tz.FETCH);await this.fs.mkdir(sE().dirname(t)),await this.fs.writeFile(t,JSON.stringify({...n,tags:a.tags}))}}}getFilePath(t,r){switch(r){case tz.FETCH:return sE().join(this.serverDistDir,"..","cache","fetch-cache",t);case tz.PAGES:return sE().join(this.serverDistDir,"pages",t);case tz.IMAGE:case tz.APP_PAGE:case tz.APP_ROUTE:return sE().join(this.serverDistDir,"app",t);default:throw Object.defineProperty(Error(`Unexpected file path kind: ${r}`),"__NEXT_ERROR_CODE",{value:"E479",enumerable:!1})}}}class an{static #e=this.timings=new Map;constructor(t){this.prerenderManifest=t}get(t){var r,s;let n=an.timings.get(t);if(void 0!==n||void 0!==(n=null==(r=this.prerenderManifest.routes[t])?void 0:r.initialRevalidateSeconds)||void 0!==(n=null==(s=this.prerenderManifest.dynamicRoutes[t])?void 0:s.fallbackRevalidate))return n}set(t,r){an.timings.set(t,r)}clear(){an.timings.clear()}}let aa=nm();class ai{constructor({fs:t,dev:r,dynamicIO:s,flushToDisk:n,minimalMode:a,serverDistDir:i,requestHeaders:o,requestProtocol:B,maxMemoryCacheSize:l,getPrerenderManifest:u,fetchCacheKeyPrefix:c,CurCacheHandler:d,allowedRevalidateHeaderKeys:p}){var C,f,m,h;this.locks=new Map;let y=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;this.hasCustomCacheHandler=!!d;let g=Symbol.for("@next/cache-handlers"),b=globalThis;if(d)y&&console.log("using custom cache handler",d.name);else{let r=b[g];(null==r?void 0:r.FetchCache)?d=r.FetchCache:t&&i&&(y&&console.log("using filesystem cache handler"),d=as)}process.env.__NEXT_TEST_MAX_ISR_CACHE&&(l=parseInt(process.env.__NEXT_TEST_MAX_ISR_CACHE,10)),this.dev=r,this.hasDynamicIO=s,this.disableForTestmode="true"===process.env.NEXT_PRIVATE_TEST_PROXY,this.minimalMode=a,this.requestHeaders=o,this.requestProtocol=B,this.allowedRevalidateHeaderKeys=p,this.prerenderManifest=u(),this.revalidateTimings=new an(this.prerenderManifest),this.fetchCacheKeyPrefix=c;let D=[];o[e7.kz]===(null==(f=this.prerenderManifest)?void 0:null==(C=f.preview)?void 0:C.previewModeId)&&(this.isOnDemandRevalidate=!0),a&&"string"==typeof o[e7.vS]&&o[e7.c1]===(null==(h=this.prerenderManifest)?void 0:null==(m=h.preview)?void 0:m.previewModeId)&&(D=o[e7.vS].split(",")),d&&(this.cacheHandler=new d({dev:r,fs:t,flushToDisk:n,serverDistDir:i,revalidatedTags:D,maxMemoryCacheSize:l,_requestHeaders:o,fetchCacheKeyPrefix:c}))}calculateRevalidate(t,r,s,n){if(s)return Math.floor(performance.timeOrigin+performance.now()-1e3);let a=this.revalidateTimings.get(nu(t))??(!n&&1);return"number"==typeof a?1e3*a+r:a}_getPathname(t,r){return r?t:sA(t)}resetRequestCache(){var t,r;null==(r=this.cacheHandler)||null==(t=r.resetRequestCache)||t.call(r)}async lock(t){let r=()=>Promise.resolve(),s=this.locks.get(t);s&&await s;let n=new Promise(s=>{r=async()=>{s(),this.locks.delete(t)}});return this.locks.set(t,n),r}async revalidateTag(t){var r,s;return null==(s=this.cacheHandler)?void 0:null==(r=s.revalidateTag)?void 0:r.call(s,t)}async generateCacheKey(t,r={}){let s="v3",n=[],a=new TextEncoder,i=new TextDecoder;if(r.body){if("function"==typeof r.body.getReader){let t=r.body,s=[];try{await t.pipeTo(new WritableStream({write(t){"string"==typeof t?(s.push(a.encode(t)),n.push(t)):(s.push(t),n.push(i.decode(t,{stream:!0})))}})),n.push(i.decode());let o=s.reduce((t,r)=>t+r.length,0),B=new Uint8Array(o),l=0;for(let t of s)B.set(t,l),l+=t.length;r._ogBody=B}catch(t){console.error("Problem reading body",t)}}else if("function"==typeof r.body.keys){let t=r.body;for(let s of(r._ogBody=r.body,new Set([...t.keys()]))){let r=t.getAll(s);n.push(`${s}=${(await Promise.all(r.map(async t=>"string"==typeof t?t:await t.text()))).join(",")}`)}}else if("function"==typeof r.body.arrayBuffer){let t=r.body,s=await t.arrayBuffer();n.push(await t.text()),r._ogBody=new Blob([s],{type:t.type})}else"string"==typeof r.body&&(n.push(r.body),r._ogBody=r.body)}let o="function"==typeof(r.headers||{}).keys?Object.fromEntries(r.headers):Object.assign({},r.headers);"traceparent"in o&&delete o.traceparent;let B=JSON.stringify([s,this.fetchCacheKeyPrefix||"",t,r.method,o,r.mode,r.redirect,r.credentials,r.referrer,r.referrerPolicy,r.integrity,r.cache,n]);return __webpack_require__("crypto").createHash("sha256").update(B).digest("hex")}async get(t,r){var s,n;let a,i;if(this.hasDynamicIO&&r.kind===tz.FETCH){let r=aa.getStore(),s=r?(0,F.getRenderResumeDataCache)(r):null;if(s){let r=s.fetch.get(t);if((null==r?void 0:r.kind)===tY.FETCH)return{isStale:!1,value:r,revalidateAfter:!1,isFallback:!1}}}if(this.disableForTestmode||this.dev&&(r.kind!==tz.FETCH||"no-cache"===this.requestHeaders["cache-control"]))return null;let{isFallback:o}=r;t=this._getPathname(t,r.kind===tz.FETCH);let B=null,l=r.revalidate,u=await (null==(s=this.cacheHandler)?void 0:s.get(t,r));if((null==u?void 0:null==(n=u.value)?void 0:n.kind)===tY.FETCH){if([...r.tags||[],...r.softTags||[]].some(t=>{var r;return null==(r=this.revalidatedTags)?void 0:r.includes(t)}))return null;l=l||u.value.revalidate;let t=(performance.timeOrigin+performance.now()-(u.lastModified||0))/1e3>l,s=u.value.data;return{isStale:t,value:{kind:tY.FETCH,data:s,revalidate:l},revalidateAfter:performance.timeOrigin+performance.now()+1e3*l,isFallback:o}}let c=this.revalidateTimings.get(nu(t));return(null==u?void 0:u.lastModified)===-1?(a=-1,i=-1*e7.qF):a=!!(!1!==(i=this.calculateRevalidate(t,(null==u?void 0:u.lastModified)||performance.timeOrigin+performance.now(),!!this.dev&&r.kind!==tz.FETCH,r.isFallback))&&i<performance.timeOrigin+performance.now())||void 0,u&&(B={isStale:a,curRevalidate:c,revalidateAfter:i,value:u.value,isFallback:o}),!u&&this.prerenderManifest.notFoundRoutes.includes(t)&&(B={isStale:a,value:null,curRevalidate:c,revalidateAfter:i,isFallback:o},this.set(t,B.value,r)),B}async set(t,r,s){if(this.hasDynamicIO&&(null==r?void 0:r.kind)===tY.FETCH){let s=aa.getStore(),n=s?(0,F.getPrerenderResumeDataCache)(s):null;n&&n.fetch.set(t,r)}if(this.disableForTestmode||this.dev&&!s.fetchCache)return;t=this._getPathname(t,s.fetchCache);let n=JSON.stringify(r).length;if(s.fetchCache&&!this.hasCustomCacheHandler&&n>2097152){if(this.dev)throw Object.defineProperty(Error(`Failed to set Next.js data cache, items over 2MB can not be cached (${n} bytes)`),"__NEXT_ERROR_CODE",{value:"E86",enumerable:!1});return}try{var a;void 0===s.revalidate||s.fetchCache||this.revalidateTimings.set(nu(t),s.revalidate),await (null==(a=this.cacheHandler)?void 0:a.set(t,r,s))}catch(r){console.warn("Failed to update prerender cache for",t,r)}}}let ao=require("http"),aB=require("https");function al(t){if(!globalThis.__NEXT_HTTP_AGENT){if(!t)throw Object.defineProperty(Error("Expected config.httpAgentOptions to be an object"),"__NEXT_ERROR_CODE",{value:"E204",enumerable:!1});globalThis.__NEXT_HTTP_AGENT_OPTIONS=t.httpAgentOptions,globalThis.__NEXT_HTTP_AGENT=new ao.Agent(t.httpAgentOptions),globalThis.__NEXT_HTTPS_AGENT=new aB.Agent(t.httpAgentOptions)}}function au(t){return t.definition.kind===rG.PAGES_API}let ac={existsSync:f().existsSync,readFile:f().promises.readFile,readFileSync:f().readFileSync,writeFile:(t,r)=>f().promises.writeFile(t,r),mkdir:t=>f().promises.mkdir(t,{recursive:!0}),stat:t=>f().promises.stat(t)};class ad extends n8().Readable{constructor({url:t,headers:r,method:s,socket:n=null,readable:a}){super(),this.httpVersion="1.0",this.httpVersionMajor=1,this.httpVersionMinor=0,this.socket=new Proxy({},{get:(t,r)=>{if("encrypted"!==r&&"remoteAddress"!==r)throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1});if("remoteAddress"!==r)return!1}}),this.url=t,this.headers=r,this.method=s,a&&(this.bodyReadable=a,this.bodyReadable.on("end",()=>this.emit("end")),this.bodyReadable.on("close",()=>this.emit("close"))),n&&(this.socket=n)}get headersDistinct(){let t={};for(let[r,s]of Object.entries(this.headers))s&&(t[r]=Array.isArray(s)?s:[s]);return t}_read(t){if(this.bodyReadable)return this.bodyReadable._read(t);this.emit("end"),this.emit("close")}get connection(){return this.socket}get aborted(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1})}get complete(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1})}get trailers(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1})}get trailersDistinct(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1})}get rawTrailers(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1})}get rawHeaders(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}setTimeout(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}}class ap extends n8().Writable{constructor(t={}){super(),this.statusMessage="",this.finished=!1,this.headersSent=!1,this.buffers=[],this.statusCode=t.statusCode??200,this.socket=t.socket??null,this.headers=t.headers?re(t.headers):new Headers,this.headPromise=new Promise(t=>{this.headPromiseResolve=t}),this.hasStreamed=new Promise((t,r)=>{this.on("finish",()=>t(!0)),this.on("end",()=>t(!0)),this.on("error",t=>r(t))}).then(t=>(null==this.headPromiseResolve||this.headPromiseResolve.call(this),t)),t.resWriter&&(this.resWriter=t.resWriter)}appendHeader(t,r){for(let s of Array.isArray(r)?r:[r])this.headers.append(t,s);return this}get isSent(){return this.finished||this.headersSent}get connection(){return this.socket}write(t){return this.resWriter?this.resWriter(t):(this.buffers.push(Buffer.isBuffer(t)?t:Buffer.from(t)),!0)}end(){return this.finished=!0,super.end(...arguments)}_implicitHeader(){}_write(t,r,s){this.write(t),s()}writeHead(t,r,s){if(s||"string"==typeof r?"string"==typeof r&&r.length>0&&(this.statusMessage=r):s=r,s){if(Array.isArray(s))for(let t=0;t<s.length;t+=2)this.setHeader(s[t],s[t+1]);else for(let[t,r]of Object.entries(s))void 0!==r&&this.setHeader(t,r)}return this.statusCode=t,this.headersSent=!0,null==this.headPromiseResolve||this.headPromiseResolve.call(this),this}hasHeader(t){return this.headers.has(t)}getHeader(t){return this.headers.get(t)??void 0}getHeaders(){return rr(this.headers)}getHeaderNames(){return Array.from(this.headers.keys())}setHeader(t,r){if(Array.isArray(r))for(let s of(this.headers.delete(t),r))this.headers.append(t,s);else"number"==typeof r?this.headers.set(t,r.toString()):this.headers.set(t,r);return this}removeHeader(t){this.headers.delete(t)}flushHeaders(){}get strictContentLength(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}writeEarlyHints(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}get req(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}assignSocket(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}detachSocket(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}writeContinue(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}writeProcessing(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}get upgrading(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}get chunkedEncoding(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}get shouldKeepAlive(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}get useChunkedEncodingByDefault(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}get sendDate(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}setTimeout(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}addTrailers(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}setHeaders(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1})}}function aC({url:t,headers:r={},method:s="GET",bodyReadable:n,resWriter:a,socket:i=null}){return{req:new ad({url:t,headers:r,method:s,socket:i,readable:n}),res:new ap({socket:i,resWriter:a})}}class af{async load(t){return await require(t)}}class am{static async load(t,r=new af){let s=await r.load(t);if("routeModule"in s)return s.routeModule;throw Object.defineProperty(Error(`Module "${t}" does not export a routeModule.`),"__NEXT_ERROR_CODE",{value:"E53",enumerable:!1})}}let ah=(t,r)=>{let s=c().isAbsolute(r)?r:c().join(t,r);return(0,d.pathToFileURL)(s).toString()};function ay(t){var r,s;return(null==(s=t.has)?void 0:null==(r=s[0])?void 0:r.key)===tn}class ag{add(t){this.callbacks.push(t)}async runAll(){if(!this.callbacks.length)return;let t=this.callbacks;this.callbacks=[],await Promise.allSettled(t.map(async t=>t()))}constructor(){this.callbacks=[]}}let ab=new tf(5e7),aD=new Map,ax={async get(t,r){await aD.get(t);let s=ab.get(t);if(!s)return;let n=s.entry;if(performance.timeOrigin+performance.now()>n.timestamp+1e3*n.revalidate||(0,ar.isTagStale)(n.tags,n.timestamp)||(0,ar.isTagStale)(r,n.timestamp))return;let[a,i]=n.value.tee();return n.value=i,{...n,value:a}},async set(t,r){let s=()=>{},n=new Promise(t=>{s=t});aD.set(t,n);let a=await r,i=0;try{let[r,s]=a.value.tee();a.value=r;let n=s.getReader();for(let t;!(t=await n.read()).done;)i+=Buffer.from(t.value).byteLength;ab.set(t,{entry:a,isErrored:!1,errorRetryCount:0,size:i})}catch(r){console.error(`Error while saving cache key: ${t}`,r)}finally{s(),aD.delete(t)}},async unstable_expireTags(...t){for(let r of t)ar.tagsManifest.items[r]||(ar.tagsManifest.items[r]={}),ar.tagsManifest.items[r].revalidatedAt=Date.now()},async receiveExpiredTags(...t){return this.unstable_expireTags(...t)}},av=t=>import(t).then(t=>t.default||t),aE=require,aj=new WeakMap;function aA(t){let r=aj.get(t);if(r)return r;if(!Array.isArray(t.matchers))throw Object.defineProperty(Error(`Invariant: invalid matchers for middleware ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E257",enumerable:!1});let s=n6(t.matchers);return aj.set(t,s),s}class aS extends nR{constructor(t){super(t),this.registeredInstrumentation=!1,this.cleanupListeners=new ag,this.handleNextImageRequest=async(t,r,s)=>!!(s.pathname&&s.pathname.startsWith("/_next/image"))&&(r.statusCode=400,r.body("Bad Request").send(),!0),this.handleCatchallRenderRequest=async(t,r,s)=>{let{pathname:n,query:a}=s;if(!n)throw Object.defineProperty(Error("Invariant: pathname is undefined"),"__NEXT_ERROR_CODE",{value:"E409",enumerable:!1});a._nextBubbleNoFallback="1";try{var i;n=tL(n);let o={i18n:null==(i=this.i18nProvider)?void 0:i.fromQuery(n,a)},B=await this.matchers.match(n,o);if(!B)return await this.render(t,r,n,a,s,!0),!0;for(let n of(eA(t,"match",B),this.getEdgeFunctionsPages()))if(n===B.definition.page){if("export"===this.nextConfig.output)return await this.render404(t,r,s),!0;delete a._nextBubbleNoFallback,delete a[to];try{if(await this.runEdgeFunction({req:t,res:r,query:a,params:B.params,page:B.definition.page,match:B,appPaths:null}))return!0}catch(r){throw await this.instrumentationOnRequestError(r,t,{routePath:B.definition.page,routerKind:"Pages Router",routeType:"route",revalidateReason:void 0}),r}}if(au(B)){if("export"===this.nextConfig.output)return await this.render404(t,r,s),!0;if(delete a._nextBubbleNoFallback,await this.handleApiRequest(t,r,a,B))return!0}return await this.render(t,r,n,a,s,!0),!0}catch(s){if(s instanceof nk)throw s;try{return this.logError(s),r.statusCode=500,await this.renderError(s,t,r,n,a),!0}catch{}throw s}},this.handleCatchallMiddlewareRequest=async(t,r,s)=>{let n;let a=eE(t,"middlewareInvoke");if(!a)return!1;let i=()=>(eA(t,"middlewareInvoke",!0),r.body("").send(),!0),o=this.getMiddleware();if(!o)return i();let B=tC(eE(t,"initURL")),l=rf(B.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});B.pathname=l.pathname;let u=tL(s.pathname||"");if(!o.match(u,t,B.query))return i();let c=!1;try{if(await this.ensureMiddleware(t.url),n=await this.runMiddleware({request:t,response:r,parsedUrl:B,parsed:s}),"response"in n){if(a)throw c=!0,Object.defineProperty(new t0.BubbledError(!0,n),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1});for(let[t,s]of Object.entries(rr(n.response.headers)))"content-encoding"!==t&&void 0!==s&&r.setHeader(t,s);r.statusCode=n.response.status;let{originalResponse:t}=r;return n.response.body?await rL(n.response.body,t):t.end(),!0}}catch(a){if(c)throw a;if(sd(a)&&"ENOENT"===a.code)return await this.render404(t,r,s),!0;if(a instanceof ey)return r.statusCode=400,await this.renderError(a,t,r,s.pathname||""),!0;let n=sC(a);return console.error(n),r.statusCode=500,await this.renderError(n,t,r,s.pathname||""),!0}return n.finished},this.isDev=t.dev??!1,this.renderOpts.optimizeCss&&(process.env.__NEXT_OPTIMIZE_CSS=JSON.stringify(!0)),this.renderOpts.nextScriptWorkers&&(process.env.__NEXT_SCRIPT_WORKERS=JSON.stringify(!0)),process.env.NEXT_DEPLOYMENT_ID=this.nextConfig.deploymentId||"";let{appDocumentPreloading:r}=this.nextConfig.experimental,s=void 0===r;if(t.dev||!0!==r&&s||(n4({distDir:this.distDir,page:"/_document",isAppPath:!1,isDev:this.isDev}).catch(()=>{}),n4({distDir:this.distDir,page:"/_app",isAppPath:!1,isDev:this.isDev}).catch(()=>{})),t.dev,!t.dev){let{dynamicRoutes:t=[]}=this.getRoutesManifest()??{};this.dynamicRoutes=t.map(t=>{let r=tJ(t.page);return{match:ex(r),page:t.page,re:r.re}})}al(this.nextConfig),this.middlewareManifestPath=(0,u.join)(this.serverDistDir,eR),t.dev||this.prepare().catch(t=>{console.error("Failed to prepare server",t)})}async unstable_preloadEntries(){let t=this.getAppPathsManifest();for(let t of Object.keys(this.getPagesManifest()||{}))await n4({distDir:this.distDir,page:t,isAppPath:!1,isDev:this.isDev}).catch(()=>{});for(let r of Object.keys(t||{}))await n4({distDir:this.distDir,page:r,isAppPath:!0,isDev:this.isDev}).then(async({ComponentMod:t})=>{t.patchFetch();let r=t.__next_app__.require;if(null==r?void 0:r.m)for(let t of Object.keys(r.m))await r(t)}).catch(()=>{})}async handleUpgrade(){}async loadInstrumentationModule(){if(!this.serverOptions.dev)try{this.instrumentation=await aE((0,u.resolve)(this.serverOptions.dir||".",this.serverOptions.conf.distDir,"server",e7.Hw))}catch(t){if("MODULE_NOT_FOUND"!==t.code)throw Object.defineProperty(Error("An error occurred while loading the instrumentation hook",{cause:t}),"__NEXT_ERROR_CODE",{value:"E92",enumerable:!1})}return this.instrumentation}async prepareImpl(){await super.prepareImpl(),await this.runInstrumentationHookIfAvailable()}async runInstrumentationHookIfAvailable(){var t,r;this.registeredInstrumentation||(this.registeredInstrumentation=!0,await (null==(r=this.instrumentation)?void 0:null==(t=r.register)?void 0:t.call(r)))}loadEnvConfig({dev:t,forceReload:r,silent:s}){(0,n7.loadEnvConfig)(this.dir,t,s?{info:()=>{},error:()=>{}}:B,r)}async getIncrementalCache({requestHeaders:t,requestProtocol:r}){let s;let n=!1,{cacheHandler:a}=this.nextConfig;a&&(s=nX(await av(ah(this.distDir,a))));let{cacheHandlers:i}=this.nextConfig.experimental;if(!globalThis.__nextCacheHandlers&&i){for(let t of(globalThis.__nextCacheHandlers={},Object.keys(i)))i[t]&&(globalThis.__nextCacheHandlers[t]=nX(await av(ah(this.distDir,i[t]))));i.default||(globalThis.__nextCacheHandlers.default=ax)}return new ai({fs:this.getCacheFilesystem(),dev:n,requestHeaders:t,requestProtocol:r,dynamicIO:!!this.nextConfig.experimental.dynamicIO,allowedRevalidateHeaderKeys:this.nextConfig.experimental.allowedRevalidateHeaderKeys,minimalMode:!0,serverDistDir:this.serverDistDir,fetchCacheKeyPrefix:this.nextConfig.experimental.fetchCacheKeyPrefix,maxMemoryCacheSize:this.nextConfig.cacheMaxMemorySize,flushToDisk:!1,getPrerenderManifest:()=>this.getPrerenderManifest(),CurCacheHandler:s})}getResponseCache(){return new rQ(!0)}getPublicDir(){return(0,u.join)(this.dir,eJ)}getHasStaticDir(){return f().existsSync((0,u.join)(this.dir,"static"))}getPagesManifest(){return nK((0,u.join)(this.serverDistDir,eI))}getAppPathsManifest(){if(this.enabledDirectories.app)return nK((0,u.join)(this.serverDistDir,eT))}getinterceptionRoutePatterns(){if(!this.enabledDirectories.app)return[];let t=this.getRoutesManifest();return(null==t?void 0:t.rewrites.beforeFiles.filter(ay).map(t=>new RegExp(t.regex)))??[]}async hasPage(t){var r;return!!nW(t,this.distDir,null==(r=this.nextConfig.i18n)?void 0:r.locales,this.enabledDirectories.app)}getBuildId(){let t=(0,u.join)(this.distDir,eG);try{return f().readFileSync(t,"utf8").trim()}catch(t){if("ENOENT"===t.code)throw Object.defineProperty(Error(`Could not find a production build in the '${this.distDir}' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id`),"__NEXT_ERROR_CODE",{value:"E427",enumerable:!1});throw t}}getEnabledDirectories(t){let r=t?this.dir:this.serverDistDir;return{app:!!eX(r,"app"),pages:!!eX(r,"pages")}}sendRenderResult(t,r,s){return tc({req:t.originalRequest,res:r.originalResponse,result:s.result,type:s.type,generateEtags:s.generateEtags,poweredByHeader:s.poweredByHeader,revalidate:s.revalidate,expireTime:s.expireTime})}async runApi(t,r,s,n){for(let a of this.getEdgeFunctionsPages())if(a===n.definition.pathname&&await this.runEdgeFunction({req:t,res:r,query:s,params:n.params,page:n.definition.pathname,appPaths:null}))return!0;let a=await am.load(n.definition.filename);return s={...s,...n.params},delete s.__nextLocale,delete s.__nextDefaultLocale,delete s.__nextInferredLocaleFromDefault,await a.render(t.originalRequest,r.originalResponse,{previewProps:this.renderOpts.previewProps,revalidate:this.revalidate.bind(this),trustHostHeader:this.nextConfig.experimental.trustHostHeader,allowedRevalidateHeaderKeys:this.nextConfig.experimental.allowedRevalidateHeaderKeys,hostname:this.fetchHostname,minimalMode:!0,dev:!1,query:s,params:n.params,page:n.definition.pathname,onError:this.instrumentationOnRequestError.bind(this),multiZoneDraftMode:this.nextConfig.experimental.multiZoneDraftMode}),!0}async renderHTML(t,r,s,n,a){return(0,t0.getTracer)().trace(t2.Fx.renderHTML,async()=>this.renderHTMLImpl(t,r,s,n,a))}async renderHTMLImpl(t,r,s,n,a){throw Object.defineProperty(Error("Invariant: renderHTML should not be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E472",enumerable:!1})}async imageOptimizer(t,r,s,n){throw Object.defineProperty(Error("invariant: imageOptimizer should not be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E506",enumerable:!1})}getPagePath(t,r){return nV(t,this.distDir,r,this.enabledDirectories.app)}async renderPageComponent(t,r){let s=this.getEdgeFunctionsPages()||[];if(s.length){let r=this.getOriginalAppPaths(t.pathname),n=Array.isArray(r),a=t.pathname;for(let i of(n&&(a=r[0]),s))if(i===a)return await this.runEdgeFunction({req:t.req,res:t.res,query:t.query,params:t.renderOpts.params,page:a,appPaths:r}),null}return super.renderPageComponent(t,r)}async findPageComponents({page:t,query:r,params:s,isAppPath:n,url:a}){return(0,t0.getTracer)().trace(t2.Fx.findPageComponents,{spanName:"resolve page components",attributes:{"next.route":n?tO(t):t}},()=>this.findPageComponentsImpl({page:t,query:r,params:s,isAppPath:n,url:a}))}async findPageComponentsImpl({page:t,query:r,params:s,isAppPath:n,url:a}){let i=[t];for(let a of(r.amp&&i.unshift((n?tO(t):sA(t))+".amp"),r.__nextLocale&&i.unshift(...i.map(t=>`/${r.__nextLocale}${"/"===t?"":t}`)),i))try{let t=await n4({distDir:this.distDir,page:a,isAppPath:n,isDev:this.isDev});if(r.__nextLocale&&"string"==typeof t.Component&&!a.startsWith(`/${r.__nextLocale}`))continue;return{components:t,query:{...!this.renderOpts.isExperimentalCompile&&t.getStaticProps?{amp:r.amp,__nextDataReq:r.__nextDataReq,__nextLocale:r.__nextLocale,__nextDefaultLocale:r.__nextDefaultLocale}:r,...(n?{}:s)||{}}}}catch(t){if(!(t instanceof eb))throw t}return null}getNextFontManifest(){return nK((0,u.join)(this.distDir,"server",eF+".json"))}logErrorWithOriginalStack(t,r){throw Object.defineProperty(Error("Invariant: logErrorWithOriginalStack can only be called on the development server"),"__NEXT_ERROR_CODE",{value:"E6",enumerable:!1})}async ensurePage(t){throw Object.defineProperty(Error("Invariant: ensurePage can only be called on the development server"),"__NEXT_ERROR_CODE",{value:"E291",enumerable:!1})}async handleApiRequest(t,r,s,n){return this.runApi(t,r,s,n)}getCacheFilesystem(){return ac}normalizeReq(t){return t instanceof e0?t:new e0(t)}normalizeRes(t){return t instanceof e2?t:new e2(t)}getRequestHandler(){return this.makeRequestHandler()}makeRequestHandler(){this.prepare().catch(t=>{console.error("Failed to prepare server",t)});let t=super.getRequestHandler();return(r,s,n)=>t(this.normalizeReq(r),this.normalizeRes(s),n)}async revalidate({urlPath:t,revalidateHeaders:r,opts:s}){let n=aC({url:t,headers:r}),a=this.getRequestHandler();if(await a(new e0(n.req),new e2(n.res)),await n.res.hasStreamed,"REVALIDATED"!==n.res.getHeader("x-nextjs-cache")&&!(404===n.res.statusCode&&s.unstable_onlyGenerated))throw Object.defineProperty(Error(`Invalid response ${n.res.statusCode}`),"__NEXT_ERROR_CODE",{value:"E175",enumerable:!1})}async render(t,r,s,n,a,i=!1){return super.render(this.normalizeReq(t),this.normalizeRes(r),s,n,a,i)}async renderToHTML(t,r,s,n){return super.renderToHTML(this.normalizeReq(t),this.normalizeRes(r),s,n)}async renderErrorToResponseImpl(t,r){let{req:s,res:n,query:a}=t;return 404===n.statusCode&&this.enabledDirectories.app&&this.getEdgeFunctionsPages().includes(ew)?(await this.runEdgeFunction({req:s,res:n,query:a||{},params:{},page:ew,appPaths:null}),null):super.renderErrorToResponseImpl(t,r)}async renderError(t,r,s,n,a,i){return super.renderError(t,this.normalizeReq(r),this.normalizeRes(s),n,a,i)}async renderErrorToHTML(t,r,s,n,a){return super.renderErrorToHTML(t,this.normalizeReq(r),this.normalizeRes(s),n,a)}async render404(t,r,s,n){return super.render404(this.normalizeReq(t),this.normalizeRes(r),s,n)}getMiddlewareManifest(){return null}getMiddleware(){var t;let r=this.getMiddlewareManifest(),s=null==r?void 0:null==(t=r.middleware)?void 0:t["/"];if(s)return{match:aA(s),page:"/"}}getEdgeFunctionsPages(){let t=this.getMiddlewareManifest();return t?Object.keys(t.functions):[]}getEdgeFunctionInfo(t){let r;let s=this.getMiddlewareManifest();if(!s)return null;try{r=r7(sA(t.page))}catch(t){return null}let n=t.middleware?s.middleware[r]:s.functions[r];if(!n){if(!t.middleware)throw new eb(r);return null}return{name:n.name,paths:n.files.map(t=>(0,u.join)(this.distDir,t)),wasm:(n.wasm??[]).map(t=>({...t,filePath:(0,u.join)(this.distDir,t.filePath)})),assets:n.assets&&n.assets.map(t=>({...t,filePath:(0,u.join)(this.distDir,t.filePath)})),env:n.env}}async hasMiddleware(t){let r=this.getEdgeFunctionInfo({page:t,middleware:!0});return!!(r&&r.paths.length>0)}async ensureMiddleware(t){}async ensureEdgeFunction(t){}async runMiddleware(t){throw Object.defineProperty(Error("invariant: runMiddleware should not be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E276",enumerable:!1})}getPrerenderManifest(){var t,r;return this._cachedPreviewManifest||((t=this.renderOpts,(null==(r=this.serverOptions)?void 0:r.dev)||process.env.NEXT_PHASE===eO)?this._cachedPreviewManifest={version:4,routes:{},dynamicRoutes:{},notFoundRoutes:[],preview:{previewModeId:__webpack_require__("crypto").randomBytes(16).toString("hex"),previewModeSigningKey:__webpack_require__("crypto").randomBytes(32).toString("hex"),previewModeEncryptionKey:__webpack_require__("crypto").randomBytes(32).toString("hex")}}:this._cachedPreviewManifest=nK((0,u.join)(this.distDir,ek))),this._cachedPreviewManifest}getRoutesManifest(){return(0,t0.getTracer)().trace(t2.Fx.getRoutesManifest,()=>{let t=nK((0,u.join)(this.distDir,eM)),r=t.rewrites??{beforeFiles:[],afterFiles:[],fallback:[]};return Array.isArray(r)&&(r={beforeFiles:[],afterFiles:r,fallback:[]}),{...t,rewrites:r}})}attachRequestMeta(t,r,s){var n;let a=(null==(n=t.headers["x-forwarded-proto"])?void 0:n.includes("https"))?"https":"http",i=this.fetchHostname&&this.port?`${a}://${this.fetchHostname}:${this.port}${t.url}`:this.nextConfig.experimental.trustHostHeader?`https://${t.headers.host||"localhost"}${t.url}`:t.url;eA(t,"initURL",i),eA(t,"initQuery",{...r.query}),eA(t,"initProtocol",a),s||eA(t,"clonableBody",at(t.originalRequest))}async runEdgeFunction(t){throw Object.defineProperty(Error("Middleware is not supported in minimal mode. Please remove the `NEXT_MINIMAL` environment variable."),"__NEXT_ERROR_CODE",{value:"E58",enumerable:!1})}get serverDistDir(){if(this._serverDistDir)return this._serverDistDir;let t=(0,u.join)(this.distDir,eH);return this._serverDistDir=t,t}async getFallbackErrorComponents(t){return null}async instrumentationOnRequestError(...t){await super.instrumentationOnRequestError(...t),this.logError(t[0])}onServerClose(t){this.cleanupListeners.add(t)}async close(){await this.cleanupListeners.runAll()}getInternalWaitUntil(){return this.internalWaitUntil??=this.createInternalWaitUntil(),this.internalWaitUntil}createInternalWaitUntil(){throw Object.defineProperty(new er("createInternalWaitUntil should never be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E540",enumerable:!1})}}})(),module.exports=__webpack_exports__})();
|
|
2873
2873
|
//# sourceMappingURL=server.runtime.prod.js.map
|