next 15.1.5 → 15.1.7
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 +5 -14
- 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 +5 -14
- 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/lib/verify-typescript-setup.js +1 -1
- package/dist/esm/lib/verify-typescript-setup.js.map +1 -1
- package/dist/esm/lib/worker.js +3 -2
- package/dist/esm/lib/worker.js.map +1 -1
- package/dist/esm/server/after/awaiter.js +6 -4
- package/dist/esm/server/after/awaiter.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/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/esm/server/send-response.js +4 -0
- package/dist/esm/server/send-response.js.map +1 -1
- package/dist/esm/server/web/sandbox/resource-managers.js +28 -2
- package/dist/esm/server/web/sandbox/resource-managers.js.map +1 -1
- package/dist/lib/verify-typescript-setup.js +1 -1
- package/dist/lib/verify-typescript-setup.js.map +1 -1
- package/dist/lib/worker.js +3 -2
- package/dist/lib/worker.js.map +1 -1
- package/dist/server/after/awaiter.js +6 -4
- package/dist/server/after/awaiter.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/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/server/send-response.js +4 -0
- package/dist/server/send-response.js.map +1 -1
- package/dist/server/web/sandbox/resource-managers.d.ts +3 -3
- package/dist/server/web/sandbox/resource-managers.js +28 -2
- package/dist/server/web/sandbox/resource-managers.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
|
@@ -1480,7 +1480,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1480
1480
|
isClient && new _copyfileplugin.CopyFilePlugin({
|
|
1481
1481
|
// file path to build output of `@next/polyfill-nomodule`
|
|
1482
1482
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
|
1483
|
-
cacheKey: "15.1.
|
|
1483
|
+
cacheKey: "15.1.7",
|
|
1484
1484
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
|
1485
1485
|
minimize: false,
|
|
1486
1486
|
info: {
|
|
@@ -1708,7 +1708,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1708
1708
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
|
1709
1709
|
// - Next.js version
|
|
1710
1710
|
// - next.config.js keys that affect compilation
|
|
1711
|
-
version: `${__dirname}|${"15.1.
|
|
1711
|
+
version: `${__dirname}|${"15.1.7"}|${configVars}`,
|
|
1712
1712
|
cacheDirectory: _path.default.join(distDir, 'cache', 'webpack'),
|
|
1713
1713
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
|
1714
1714
|
// 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.
|
|
65
|
+
const version = "15.1.7";
|
|
66
66
|
let router;
|
|
67
67
|
const emitter = (0, _mitt.default)();
|
|
68
68
|
const looseToArray = (input)=>[].slice.call(input);
|
|
@@ -2866,7 +2866,7 @@ ${B}`)}function a(t,r){let s;let{stackTraceLimit:n,prepareStackTrace:a}=Error;if
|
|
|
2866
2866
|
Read more: https://nextjs.org/docs/messages/middleware-request-page
|
|
2867
2867
|
`)}}class rv extends Error{constructor(){super(`The request.ua has been removed in favour of \`userAgent\` function.
|
|
2868
2868
|
Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
|
|
2869
|
-
`)}}var rE=__webpack_require__("./dist/esm/server/web/spec-extension/cookies.js");let rj=Symbol("internal request");class rA extends Request{constructor(t,r={}){let s="string"!=typeof t&&"url"in t?t.url:String(t);rn(s),t instanceof Request?super(t,r):super(s,r);let n=new rb(s,{headers:rs(this.headers),nextConfig:r.nextConfig});this[rj]={cookies:new rE.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[rj].cookies}get nextUrl(){return this[rj].nextUrl}get page(){throw new rx}get ua(){throw new rv}get url(){return this[rj].url}}let rS=t=>!0,rP=t=>!0,r_="ResponseAborted";class rw extends Error{constructor(...t){super(...t),this.name=r_}}function rI(t){let r=new AbortController;return t.once("close",()=>{t.writableFinished||r.abort(new rw)}),r}function rO(t){let{errored:r,destroyed:s}=t;if(r||s)return AbortSignal.abort(r??new rw);let{signal:n}=rI(t);return n}class rT{static fromBaseNextRequest(t,r){if(rS(t))return rT.fromNodeNextRequest(t,r);throw Error("Invariant: Unsupported NextRequest type")}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=ej(t,"initURL");s=r&&r.startsWith("http")?new URL(t.url,r):new URL(t.url,"http://n")}return new rA(s,{method:t.method,headers:rt(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 rA(t.url,{method:t.method,headers:rt(t.headers),duplex:"half",signal:t.request.signal,...t.request.signal.aborted?{}:{body:r}})}}let rN=0,rF=0,rk=0;function rM(t={}){let r=0===rN?void 0:{clientComponentLoadStart:rN,clientComponentLoadTimes:rF,clientComponentLoadCount:rk};return t.reset&&(rN=0,rF=0,rk=0),r}function rL(t){return(null==t?void 0:t.name)==="AbortError"||(null==t?void 0:t.name)===r_}function rR(t,r){let s=!1,n=new t$;function a(){n.resolve()}t.on("drain",a),t.once("close",()=>{t.off("drain",a),n.resolve()});let i=new t$;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=rM();t&&performance.measure(`${process.env.NEXT_OTEL_PERFORMANCE_PREFIX}:next-client-component-loading`,{start:t.clientComponentLoadStart,end:t.clientComponentLoadStart+t.clientComponentLoadTimes})}t.flushHeaders(),(0,t2.getTracer)().trace(t3.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 t$)}catch(r){throw t.end(),Error("failed to write chunk to response",{cause:r})}},abort:r=>{t.writableFinished||t.destroy(r)},close:async()=>{if(r&&await r,!t.writableFinished)return t.end(),i.promise}})}async function rH(t,r,s){try{let{errored:n,destroyed:a}=r;if(n||a)return;let i=rI(r),o=rR(r,s);await t.pipeTo(o,{signal:i.signal})}catch(t){if(rL(t))return;throw Error("failed to pipe response",{cause:t})}}class rG{static fromStatic(t){return new rG(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 Error("Invariant: null responses cannot be unchunked");if("string"!=typeof this.response){if(!t)throw Error("Invariant: dynamic responses cannot be unchunked. This is a bug in Next.js");return t8(this.readable)}return Buffer.from(this.response)}toUnchunkedString(t=!1){if(null===this.response)throw Error("Invariant: null responses cannot be unchunked");if("string"!=typeof this.response){if(!t)throw Error("Invariant: dynamic responses cannot be unchunked. This is a bug in Next.js");return re(this.readable)}return this.response}get readable(){if(null===this.response)throw Error("Invariant: null responses cannot be streamed");if("string"==typeof this.response)throw Error("Invariant: static responses cannot be streamed");return Buffer.isBuffer(this.response)?t9(this.response):Array.isArray(this.response)?t6(...this.response):this.response}chain(t){let r;if(null===this.response)throw Error("Invariant: response is null. This is a bug in Next.js");"string"==typeof this.response?r=[t7(this.response)]:Array.isArray(this.response)?r=this.response:Buffer.isBuffer(this.response)?r=[t9(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(rL(r)){await t.abort(r);return}throw r}}async pipeToNodeResponse(t){await rH(this.readable,t,this.waitUntil)}}var rK=/*#__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 rJ(t){var r,s;return{...t,value:(null==(r=t.value)?void 0:r.kind)===tz.PAGES?{kind:tz.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)===tz.APP_PAGE?{kind:tz.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 rU(t){var r,s,n;if(!t)return null;if((null==(r=t.value)?void 0:r.kind)===tz.FETCH)throw Error("Invariant: unexpected cachedResponse of kind fetch in response cache");return{isMiss:t.isMiss,isStale:t.isStale,revalidate:t.revalidate,isFallback:t.isFallback,value:(null==(s=t.value)?void 0:s.kind)===tz.PAGES?{kind:tz.PAGES,html:rG.fromStatic(t.value.html),pageData:t.value.pageData,headers:t.value.headers,status:t.value.status}:(null==(n=t.value)?void 0:n.kind)===tz.APP_PAGE?{kind:tz.APP_PAGE,html:rG.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 rQ(t){switch(t){case rK.PAGES:return tZ.PAGES;case rK.APP_PAGE:return tZ.APP_PAGE;case rK.IMAGE:return tZ.IMAGE;case rK.APP_ROUTE:return tZ.APP_ROUTE;default:throw Error(`Unexpected route kind ${t}`)}}class rW{constructor(t){this.batcher=t1.create({cacheKeyFn:({key:t,isOnDemandRevalidate:r})=>`${t}-${r?"1":"0"}`,schedulerFn:t0}),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 rU(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;rQ(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 rJ({...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 rV="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",rq=`(${rV}[.]){3}${rV}`,rY="(?:[0-9a-fA-F]{1,4})",rX=RegExp(`^((?:${rY}:){7}(?:${rY}|:)|(?:${rY}:){6}(?:${rq}|:${rY}|:)|(?:${rY}:){5}(?::${rq}|(:${rY}){1,2}|:)|(?:${rY}:){4}(?:(:${rY}){0,1}:${rq}|(:${rY}){1,3}|:)|(?:${rY}:){3}(?:(:${rY}){0,2}:${rq}|(:${rY}){1,4}|:)|(?:${rY}:){2}(?:(:${rY}){0,3}:${rq}|(:${rY}){1,5}|:)|(?:${rY}:){1}(?:(:${rY}){0,4}:${rq}|(:${rY}){1,6}|:)|(?::((?::${rY}){0,5}:${rq}|(?::${rY}){1,7}|:)))(%[0-9a-zA-Z-.:]{1,})?$`);function rz(t){return rX.test(t)}function rZ(t){return rz(t)?`[${t}]`:t}function r$(t){return t.statusCode||(t.permanent?eZ.PermanentRedirect:eZ.TemporaryRedirect)}function r1(t){return t===e9.li.experimentalEdge||t===e9.li.edge}let r0=/\/\[[^/]+?\](?=\/|$)/;function r2(t){return tF(t)&&(t=tk(t).interceptedRoute),r0.test(t)}let r3=require("next/dist/shared/lib/runtime-config.external.js");function r5(t){return eJ.includes(t)}let r4=/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 r6(t){return r4.test(t)}function r7(t){return t.replace(/\\/g,"/")}function r9(t){let r=r7(t);return r.startsWith("/index/")&&!r2(r)?r.slice(6):"/index"!==r?r:"/"}var r8=__webpack_require__("./dist/compiled/path-to-regexp/index.js");function se(t,r){let s=[],n=(0,r8.pathToRegexp)(t,s,{delimiter:"/",sensitive:"boolean"==typeof(null==r?void 0:r.sensitive)&&r.sensitive,strict:null==r?void 0:r.strict}),a=(0,r8.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 st(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 sr(t,r){return t.replace(RegExp(":"+tR(r),"g"),"__ESC_COLON_"+r)}function ss(t){return t.replace(/__ESC_COLON_/gi,":")}function sn(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]:e$(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[st(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 sa(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,r8.compile)("/"+t,{validate:!1})(r).slice(1)}function si(t){let r;let s=Object.assign({},t.query);delete s.__nextLocale,delete s.__nextDefaultLocale,delete s.__nextDataReq,delete s.__nextInferredLocaleFromDefault,delete s[tB];let n=t.destination;for(let r of Object.keys({...t.params,...s}))n=r?sr(n,r):n;let a=tf(n),i=a.query,o=ss(""+a.pathname+(a.hash||"")),B=ss(a.hostname||""),l=[],u=[];(0,r8.pathToRegexp)(o,l),(0,r8.pathToRegexp)(B,u);let c=[];l.forEach(t=>c.push(t.name)),u.forEach(t=>c.push(t.name));let d=(0,r8.compile)(o,{validate:!1}),p=(0,r8.compile)(B,{validate:!1});for(let[r,s]of Object.entries(i))Array.isArray(s)?i[r]=s.map(r=>sa(ss(r),t.params)):"string"==typeof s&&(i[r]=sa(ss(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(tF(o))for(let r of o.split("/")){let s=tN.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 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");throw t}return a.query={...s,...a.query},{newUrl:r,destQuery:i,parsedDestination:a}}function so(t,r,s,n,a){if(n&&r&&a){let r=(0,p.parse)(t.url,!0);for(let t of(delete r.search,Object.keys(r.query))){let n=t!==e9.AA&&t.startsWith(e9.AA),i=t!==e9.h&&t.startsWith(e9.h);(n||i||(s||Object.keys(a.groups)).includes(t))&&delete r.query[t]}t.url=(0,p.format)(r)}}function sB(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 sl(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=tT(B)),Array.isArray(B)&&(B=B.map(t=>("string"==typeof t&&(t=tT(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 su({page:t,i18n:r,basePath:s,rewrites:n,pageIsDynamic:a,trailingSlash:i,caseSensitive:o}){let B,l,u;function c(t,s,n){return ev(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!==e9.AA&&t.startsWith(e9.AA)&&(o[t.substring(e9.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=ev(B=tq(t,!1)))(t)),{handleRewrites:function(B,u){let c={},d=u.pathname,p=()=>{let r=tH(d||"");return r===tH(t)||(null==l?void 0:l(r))},C=n=>{let p=se(n.source+(i?"(/)?":""),{removeUnnamedParams:!0,strict:!0,sensitive:!!o})(u.pathname);if((n.has||n.missing)&&p){let t=sn(B,u.query,n.has,n.missing);t?Object.assign(p,t):p=!1}if(p){let{parsedDestination:i,destQuery:o}=si({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=rC(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)=>sl(t,r,B,u),normalizeVercelUrl:(t,r,s)=>so(t,r,s,a,B),interpolateDynamicPath:(t,r)=>sB(t,r,B)}}function sc(t){return Object.prototype.toString.call(t)}function sd(t){if("[object Object]"!==sc(t))return!1;let r=Object.getPrototypeOf(t);return null===r||r.hasOwnProperty("isPrototypeOf")}function sp(t){return"object"==typeof t&&null!==t&&"name"in t&&"message"in t}function sC(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 sf(t){return sp(t)?t:Error(sd(t)?sC(t):t+"")}class sm{constructor(t){this.provider=t}normalize(t){return this.provider.analyze(t).pathname}}class sh{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 Error('You cannot define a route with the same specificity as a optional catch-all route ("'+r+'" and "'+r+"[[..."+this.optionalRestSlugName+']]").');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 Error("Catch-all must be the last part of the URL.");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 Error("Detected a three-dot character ('…') at ('"+i+"'). Did you mean ('...')?");if(i.startsWith("...")&&(i=i.substring(3),s=!0),i.startsWith("[")||i.endsWith("]"))throw Error("Segment names may not start or end with extra brackets ('"+i+"').");if(i.startsWith("."))throw Error("Segment names may not start with erroneous periods ('"+i+"').");function a(t,s){if(null!==t&&t!==s)throw Error("You cannot use different slug names for the same dynamic path ('"+t+"' !== '"+s+"').");r.forEach(t=>{if(t===s)throw Error('You cannot have the same slug name "'+s+'" repeat within a single dynamic path');if(t.replace(/\W/g,"")===n.replace(/\W/g,""))throw Error('You cannot have the slug names "'+t+'" and "'+s+'" differ only by non-word symbols within a single dynamic path')}),r.push(s)}if(s){if(o){if(null!=this.restSlugName)throw Error('You cannot use both an required and optional catch-all route at the same level ("[...'+this.restSlugName+']" and "'+t[0]+'" ).');a(this.optionalRestSlugName,i),this.optionalRestSlugName=i,n="[[...]]"}else{if(null!=this.optionalRestSlugName)throw Error('You cannot use both an optional and required catch-all route at the same level ("[[...'+this.optionalRestSlugName+']]" and "'+t[0]+'").');a(this.restSlugName,i),this.restSlugName=i,n="[...]"}}else{if(o)throw Error('Optional route parameters are not yet supported ("'+t[0]+'").');a(this.slugName,i),this.slugName=i,n="[]"}}this.children.has(n)||this.children.set(n,new sh),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 sy(t){let r=new sh;return t.forEach(t=>r.insert(t)),r.smoosh()}class sg{constructor(t){this.definition=t,r2(t.pathname)&&(this.dynamic=ev(tU(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 sb extends sg{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 sD{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 t$;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=sy(B),u=[];for(let t of l){let r=o.get(t);if(!Array.isArray(r))throw Error("Invariant: expected to find identity in indexes map");let s=r.map(t=>i[t]);u.push(...s)}if(this.matchers.dynamic=u,this.compilationID!==n)throw Error("Invariant: expected compilation to finish before new matchers were added, possible missing await")}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 sb?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 Error("Invariant: expected routes to have been loaded before match");if(!r2(t=tw(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 sx(t){return t.endsWith("/page")}class sv{constructor(t=[]){this.normalizers=t}push(t){this.normalizers.push(t)}normalize(t){return this.normalizers.reduce((t,r)=>r.normalize(t),t)}}var sE=__webpack_require__("./dist/esm/shared/lib/isomorphic/path.js"),sj=/*#__PURE__*/__webpack_require__.n(sE);class sA{constructor(...t){this.prefix=sj().posix.join(...t)}normalize(t){return sj().posix.join(this.prefix,t)}}function sS(t){let r=/^\/index(\/|$)/.test(t)&&!r2(t)?"/index"+t:"/"===t?"/index":tw(t);{let{posix:t}=__webpack_require__("path"),s=t.normalize(r);if(s!==r)throw new eb("Requested and resolved page mismatch: "+r+" "+s)}return r}class sP extends sA{constructor(){super("app")}normalize(t){return super.normalize(sS(t))}}class s_ extends sA{constructor(t){super(t,eG)}normalize(t){return super.normalize(t)}}let sw={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"]}},sI=["js","jsx","ts","tsx"],sO=(t,r)=>r?`(?:\\.(${t.join("|")})|((\\[\\])?\\.(${r.join("|")})))`:`\\.(?:${t.join("|")})`;function sT(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(`[\\\\/]${sw.icon.filename}\\d?${s?`${sO(sw.icon.extensions,r)}$`:""}`),RegExp(`[\\\\/]${sw.apple.filename}\\d?${s?`${sO(sw.apple.extensions,r)}$`:""}`),RegExp(`[\\\\/]${sw.openGraph.filename}\\d?${s?`${sO(sw.openGraph.extensions,r)}$`:""}`),RegExp(`[\\\\/]${sw.twitter.filename}\\d?${s?`${sO(sw.twitter.extensions,r)}$`:""}`)],a=r7(t);return n.some(t=>t.test(a))}function sN(t){let r=t.replace(/^\/?app\//,"").replace(/\/route$/,"");return"/"!==r[0]&&(r="/"+r),!r.endsWith("/page")&&sT(r,sI,!1)}function sF(t){return{normalize:t}}class sk{normalize(t){return t.replace(/%5F/g,"_")}}class sM extends sv{constructor(){super([sF(tO),new sk])}normalize(t){return super.normalize(t)}}class sL{constructor(t){this.filename=new s_(t),this.pathname=new sM,this.bundlePath=new sP}}class sR extends sg{get identity(){return`${this.definition.pathname}?__nextPage=${this.definition.page}`}}class sH{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 sG extends sH{constructor(t,r){super({load:async()=>r.load(t),compare:(t,r)=>t===r})}}class sK extends sG{constructor(t,r){super(eN,r),this.normalizers=new sL(t)}async transform(t){let r=Object.keys(t).filter(t=>sx(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:rK.APP_PAGE,pathname:r,page:s,bundlePath:o,filename:i,appPaths:a}))}return n}}function sJ(t){return t.endsWith("/route")}class sU extends sg{}class sQ extends sG{constructor(t,r){super(eN,r),this.normalizers=new sL(t)}async transform(t){let r=Object.keys(t).filter(t=>sJ(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 sU({kind:rK.APP_ROUTE,pathname:a,page:n,bundlePath:i,filename:r}))}return s}}function sW(t){return"/api"===t||!!(null==t?void 0:t.startsWith("/api/"))}class sV extends sg{}class sq extends sb{}class sY extends sv{constructor(){super([sF(sS),new sA("pages")])}normalize(t){return super.normalize(t)}}class sX extends sA{constructor(t){super(t,eG)}normalize(t){return super.normalize(t)}}class sz{constructor(t){this.filename=new sX(t),this.bundlePath=new sY}}class sZ extends sG{constructor(t,r,s){super(eT,r),this.i18nProvider=s,this.normalizers=new sz(t)}async transform(t){let r=Object.keys(t).filter(t=>sW(t)),s=[];for(let n of r)if(this.i18nProvider){let{detectedLocale:r,pathname:a}=this.i18nProvider.analyze(n);s.push(new sq({kind:rK.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 sV({kind:rK.PAGES_API,pathname:n,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(t[n])}));return s}}class s$ extends sg{}class s1 extends sb{}class s0 extends sG{constructor(t,r,s){super(eT,r),this.i18nProvider=s,this.normalizers=new sz(t)}async transform(t){let r=Object.keys(t).filter(t=>!sW(t)).filter(t=>{var r;let s=(null==(r=this.i18nProvider)?void 0:r.analyze(t).pathname)??t;return!eJ.includes(s)}),s=[];for(let n of r)if(this.i18nProvider){let{detectedLocale:r,pathname:a}=this.i18nProvider.analyze(n);s.push(new s1({kind:rK.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 s$({kind:rK.PAGES,pathname:n,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(t[n])}));return s}}class s2{constructor(t){this.getter=t}load(t){return this.getter(t)}}class s3{constructor(t){var r;if(this.config=t,!t.locales.length)throw Error("Invariant: No locales provided");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 Error(`Invariant: The detected locale does not match the locale in the query. Expected to find '${s}' in '${t}' but found '${r.detectedLocale}'}`);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 s5(t,r,s,n){if(rP(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 rr(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 rH(s.body,o,n):o.end()}}let s4=se("/_next/data/:path*");function s6(t){return"string"==typeof t&&s4(t)}function s7(t,r){return void 0===r&&(r=""),t=t.replace(/\\/g,"/"),(t=r&&t.endsWith(r)?t.slice(0,-r.length):t).startsWith("/index/")&&!r2(t)?t=t.slice(6):"/index"===t&&(t="/"),t}function s9(t,r){return t.replace(RegExp("([/#?]"+(r?"|%(2f|23|3f|5c)":"")+")","gi"),t=>encodeURIComponent(t))}function s8(t){return t.split("/").map(t=>{try{t=s9(decodeURIComponent(t),!0)}catch(t){throw new eg("Failed to decode path param(s).")}return t}).join("/")}class ne{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 nt extends ne{constructor(){super(e9.RM)}}function nr(t){for(let r of to)delete t[r.toLowerCase()]}function ns(t){return t.definition.kind===rK.APP_ROUTE}function nn(t){return t.definition.kind===rK.APP_PAGE}function na(t){return t.definition.kind===rK.PAGES}class ni extends ne{constructor(){super(e9.pu)}match(t){return t==="/__index"+e9.pu||super.match(t)}normalize(t,r){return t==="/__index"+e9.pu?"/":super.normalize(t,r)}}class no{constructor(t){if(this.prefix=t,t.endsWith("/"))throw Error(`PrefixPathnameNormalizer: prefix "${t}" should not end with a slash`)}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 nB{constructor(t){if(this.suffix=new ne(".json"),!t)throw Error("Invariant: buildID is required");this.prefix=new no(`/_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),r9(t=this.suffix.normalize(t,!0))):t}}function nl(t){let r,s;t.headers instanceof Headers?(r=t.headers.get(tt.toLowerCase())??null,s=t.headers.get("content-type")):(r=t.headers[tt.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 nu(t){return nl(t).isServerAction}function nc(t){return t.replace(/(?:\/index)?\/?$/,"")||"/"}function nd(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=ej(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 np(t){return void 0!==t&&("boolean"==typeof t?t:"incremental"===t)}let nC=Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");class nf{disable(){throw nC}getStore(){}run(){throw nC}exit(){throw nC}enterWith(){throw nC}static bind(t){return t}}let nm="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function nh(){return nm?new nm:new nf}function ny(){let t=globalThis[ng];return null==t?void 0:t.get()}let ng=Symbol.for("@next/request-context");Symbol("response"),Symbol("passThrough"),Symbol("waitUntil");var nb=__webpack_require__("./dist/esm/server/web/spec-extension/adapters/reflect.js");let nD=Symbol("internal response"),nx=new Set([301,302,303,307,308]);function nv(t,r){var s;if(null==t?void 0:null==(s=t.request)?void 0:s.headers){if(!(t.request.headers instanceof Headers))throw Error("request.headers must be an instance of Headers");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 nE extends Response{constructor(t,r={}){super(t,r);let s=this.headers,n=new Proxy(new rE.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 rE.VO&&s.set("x-middleware-set-cookie",i.getAll().map(t=>(0,rE.Ud)(t)).join(",")),nv(r,o),i};default:return nb.l.get(t,n,a)}}});this[nD]={cookies:n,url:r.url?new rb(r.url,{headers:rs(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[nD].cookies}static json(t,r){let s=Response.json(t,r);return new nE(s.body,s)}static redirect(t,r){let s="number"==typeof r?r:(null==r?void 0:r.status)??307;if(!nx.has(s))throw RangeError('Failed to execute "redirect" on "response": Invalid status code');let n="object"==typeof r?r:{},a=new Headers(null==n?void 0:n.headers);return a.set("Location",rn(t)),new nE(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",rn(t)),nv(r,s),new nE(null,{...r,headers:s})}static next(t){let r=new Headers(null==t?void 0:t.headers);return r.set("x-middleware-next","1"),nv(t,r),new nE(null,{...t,headers:r})}}async function nj(){return"_ENTRIES"in globalThis&&_ENTRIES.middleware_instrumentation&&await _ENTRIES.middleware_instrumentation}let nA=null;async function nS(){if("phase-production-build"===process.env.NEXT_PHASE)return;nA||(nA=nj());let t=await nA;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 nP=null;function n_(){return nP||(nP=nS()),nP}function nw(t){return`The edge runtime does not support Node.js '${t}' module.
|
|
2869
|
+
`)}}var rE=__webpack_require__("./dist/esm/server/web/spec-extension/cookies.js");let rj=Symbol("internal request");class rA extends Request{constructor(t,r={}){let s="string"!=typeof t&&"url"in t?t.url:String(t);rn(s),t instanceof Request?super(t,r):super(s,r);let n=new rb(s,{headers:rs(this.headers),nextConfig:r.nextConfig});this[rj]={cookies:new rE.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[rj].cookies}get nextUrl(){return this[rj].nextUrl}get page(){throw new rx}get ua(){throw new rv}get url(){return this[rj].url}}let rS=t=>!0,rP=t=>!0,r_="ResponseAborted";class rw extends Error{constructor(...t){super(...t),this.name=r_}}function rI(t){let r=new AbortController;return t.once("close",()=>{t.writableFinished||r.abort(new rw)}),r}function rO(t){let{errored:r,destroyed:s}=t;if(r||s)return AbortSignal.abort(r??new rw);let{signal:n}=rI(t);return n}class rT{static fromBaseNextRequest(t,r){if(rS(t))return rT.fromNodeNextRequest(t,r);throw Error("Invariant: Unsupported NextRequest type")}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=ej(t,"initURL");s=r&&r.startsWith("http")?new URL(t.url,r):new URL(t.url,"http://n")}return new rA(s,{method:t.method,headers:rt(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 rA(t.url,{method:t.method,headers:rt(t.headers),duplex:"half",signal:t.request.signal,...t.request.signal.aborted?{}:{body:r}})}}let rN=0,rF=0,rk=0;function rM(t={}){let r=0===rN?void 0:{clientComponentLoadStart:rN,clientComponentLoadTimes:rF,clientComponentLoadCount:rk};return t.reset&&(rN=0,rF=0,rk=0),r}function rL(t){return(null==t?void 0:t.name)==="AbortError"||(null==t?void 0:t.name)===r_}function rR(t,r){let s=!1,n=new t$;function a(){n.resolve()}t.on("drain",a),t.once("close",()=>{t.off("drain",a),n.resolve()});let i=new t$;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=rM();t&&performance.measure(`${process.env.NEXT_OTEL_PERFORMANCE_PREFIX}:next-client-component-loading`,{start:t.clientComponentLoadStart,end:t.clientComponentLoadStart+t.clientComponentLoadTimes})}t.flushHeaders(),(0,t2.getTracer)().trace(t3.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 t$)}catch(r){throw t.end(),Error("failed to write chunk to response",{cause:r})}},abort:r=>{t.writableFinished||t.destroy(r)},close:async()=>{if(r&&await r,!t.writableFinished)return t.end(),i.promise}})}async function rH(t,r,s){try{let{errored:n,destroyed:a}=r;if(n||a)return;let i=rI(r),o=rR(r,s);await t.pipeTo(o,{signal:i.signal})}catch(t){if(rL(t))return;throw Error("failed to pipe response",{cause:t})}}class rG{static fromStatic(t){return new rG(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 Error("Invariant: null responses cannot be unchunked");if("string"!=typeof this.response){if(!t)throw Error("Invariant: dynamic responses cannot be unchunked. This is a bug in Next.js");return t8(this.readable)}return Buffer.from(this.response)}toUnchunkedString(t=!1){if(null===this.response)throw Error("Invariant: null responses cannot be unchunked");if("string"!=typeof this.response){if(!t)throw Error("Invariant: dynamic responses cannot be unchunked. This is a bug in Next.js");return re(this.readable)}return this.response}get readable(){if(null===this.response)throw Error("Invariant: null responses cannot be streamed");if("string"==typeof this.response)throw Error("Invariant: static responses cannot be streamed");return Buffer.isBuffer(this.response)?t9(this.response):Array.isArray(this.response)?t6(...this.response):this.response}chain(t){let r;if(null===this.response)throw Error("Invariant: response is null. This is a bug in Next.js");"string"==typeof this.response?r=[t7(this.response)]:Array.isArray(this.response)?r=this.response:Buffer.isBuffer(this.response)?r=[t9(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(rL(r)){await t.abort(r);return}throw r}}async pipeToNodeResponse(t){await rH(this.readable,t,this.waitUntil)}}var rK=/*#__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 rJ(t){var r,s;return{...t,value:(null==(r=t.value)?void 0:r.kind)===tz.PAGES?{kind:tz.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)===tz.APP_PAGE?{kind:tz.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 rU(t){var r,s,n;if(!t)return null;if((null==(r=t.value)?void 0:r.kind)===tz.FETCH)throw Error("Invariant: unexpected cachedResponse of kind fetch in response cache");return{isMiss:t.isMiss,isStale:t.isStale,revalidate:t.revalidate,isFallback:t.isFallback,value:(null==(s=t.value)?void 0:s.kind)===tz.PAGES?{kind:tz.PAGES,html:rG.fromStatic(t.value.html),pageData:t.value.pageData,headers:t.value.headers,status:t.value.status}:(null==(n=t.value)?void 0:n.kind)===tz.APP_PAGE?{kind:tz.APP_PAGE,html:rG.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 rQ(t){switch(t){case rK.PAGES:return tZ.PAGES;case rK.APP_PAGE:return tZ.APP_PAGE;case rK.IMAGE:return tZ.IMAGE;case rK.APP_ROUTE:return tZ.APP_ROUTE;default:throw Error(`Unexpected route kind ${t}`)}}class rW{constructor(t){this.batcher=t1.create({cacheKeyFn:({key:t,isOnDemandRevalidate:r})=>`${t}-${r?"1":"0"}`,schedulerFn:t0}),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 rU(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;rQ(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 rJ({...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 rV="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",rq=`(${rV}[.]){3}${rV}`,rY="(?:[0-9a-fA-F]{1,4})",rX=RegExp(`^((?:${rY}:){7}(?:${rY}|:)|(?:${rY}:){6}(?:${rq}|:${rY}|:)|(?:${rY}:){5}(?::${rq}|(:${rY}){1,2}|:)|(?:${rY}:){4}(?:(:${rY}){0,1}:${rq}|(:${rY}){1,3}|:)|(?:${rY}:){3}(?:(:${rY}){0,2}:${rq}|(:${rY}){1,4}|:)|(?:${rY}:){2}(?:(:${rY}){0,3}:${rq}|(:${rY}){1,5}|:)|(?:${rY}:){1}(?:(:${rY}){0,4}:${rq}|(:${rY}){1,6}|:)|(?::((?::${rY}){0,5}:${rq}|(?::${rY}){1,7}|:)))(%[0-9a-zA-Z-.:]{1,})?$`);function rz(t){return rX.test(t)}function rZ(t){return rz(t)?`[${t}]`:t}function r$(t){return t.statusCode||(t.permanent?eZ.PermanentRedirect:eZ.TemporaryRedirect)}function r1(t){return t===e9.li.experimentalEdge||t===e9.li.edge}let r0=/\/\[[^/]+?\](?=\/|$)/;function r2(t){return tF(t)&&(t=tk(t).interceptedRoute),r0.test(t)}let r3=require("next/dist/shared/lib/runtime-config.external.js");function r5(t){return eJ.includes(t)}let r4=/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 r6(t){return r4.test(t)}function r7(t){return t.replace(/\\/g,"/")}function r9(t){let r=r7(t);return r.startsWith("/index/")&&!r2(r)?r.slice(6):"/index"!==r?r:"/"}var r8=__webpack_require__("./dist/compiled/path-to-regexp/index.js");function se(t,r){let s=[],n=(0,r8.pathToRegexp)(t,s,{delimiter:"/",sensitive:"boolean"==typeof(null==r?void 0:r.sensitive)&&r.sensitive,strict:null==r?void 0:r.strict}),a=(0,r8.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 st(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 sr(t,r){return t.replace(RegExp(":"+tR(r),"g"),"__ESC_COLON_"+r)}function ss(t){return t.replace(/__ESC_COLON_/gi,":")}function sn(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]:e$(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[st(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 sa(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,r8.compile)("/"+t,{validate:!1})(r).slice(1)}function si(t){let r;let s=Object.assign({},t.query);delete s.__nextLocale,delete s.__nextDefaultLocale,delete s.__nextDataReq,delete s.__nextInferredLocaleFromDefault,delete s[tB];let n=t.destination;for(let r of Object.keys({...t.params,...s}))n=r?sr(n,r):n;let a=tf(n),i=a.query,o=ss(""+a.pathname+(a.hash||"")),B=ss(a.hostname||""),l=[],u=[];(0,r8.pathToRegexp)(o,l),(0,r8.pathToRegexp)(B,u);let c=[];l.forEach(t=>c.push(t.name)),u.forEach(t=>c.push(t.name));let d=(0,r8.compile)(o,{validate:!1}),p=(0,r8.compile)(B,{validate:!1});for(let[r,s]of Object.entries(i))Array.isArray(s)?i[r]=s.map(r=>sa(ss(r),t.params)):"string"==typeof s&&(i[r]=sa(ss(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(tF(o))for(let r of o.split("/")){let s=tN.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 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");throw t}return a.query={...s,...a.query},{newUrl:r,destQuery:i,parsedDestination:a}}function so(t,r,s,n,a){if(n&&r&&a){let r=(0,p.parse)(t.url,!0);for(let t of(delete r.search,Object.keys(r.query))){let n=t!==e9.AA&&t.startsWith(e9.AA),i=t!==e9.h&&t.startsWith(e9.h);(n||i||(s||Object.keys(a.groups)).includes(t))&&delete r.query[t]}t.url=(0,p.format)(r)}}function sB(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 sl(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=tT(B)),Array.isArray(B)&&(B=B.map(t=>("string"==typeof t&&(t=tT(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 su({page:t,i18n:r,basePath:s,rewrites:n,pageIsDynamic:a,trailingSlash:i,caseSensitive:o}){let B,l,u;function c(t,s,n){return ev(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!==e9.AA&&t.startsWith(e9.AA)&&(o[t.substring(e9.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=ev(B=tq(t,!1)))(t)),{handleRewrites:function(B,u){let c={},d=u.pathname,p=()=>{let r=tH(d||"");return r===tH(t)||(null==l?void 0:l(r))},C=n=>{let p=se(n.source+(i?"(/)?":""),{removeUnnamedParams:!0,strict:!0,sensitive:!!o})(u.pathname);if((n.has||n.missing)&&p){let t=sn(B,u.query,n.has,n.missing);t?Object.assign(p,t):p=!1}if(p){let{parsedDestination:i,destQuery:o}=si({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=rC(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)=>sl(t,r,B,u),normalizeVercelUrl:(t,r,s)=>so(t,r,s,a,B),interpolateDynamicPath:(t,r)=>sB(t,r,B)}}function sc(t){return Object.prototype.toString.call(t)}function sd(t){if("[object Object]"!==sc(t))return!1;let r=Object.getPrototypeOf(t);return null===r||r.hasOwnProperty("isPrototypeOf")}function sp(t){return"object"==typeof t&&null!==t&&"name"in t&&"message"in t}function sC(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 sf(t){return sp(t)?t:Error(sd(t)?sC(t):t+"")}class sm{constructor(t){this.provider=t}normalize(t){return this.provider.analyze(t).pathname}}class sh{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 Error('You cannot define a route with the same specificity as a optional catch-all route ("'+r+'" and "'+r+"[[..."+this.optionalRestSlugName+']]").');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 Error("Catch-all must be the last part of the URL.");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 Error("Detected a three-dot character ('…') at ('"+i+"'). Did you mean ('...')?");if(i.startsWith("...")&&(i=i.substring(3),s=!0),i.startsWith("[")||i.endsWith("]"))throw Error("Segment names may not start or end with extra brackets ('"+i+"').");if(i.startsWith("."))throw Error("Segment names may not start with erroneous periods ('"+i+"').");function a(t,s){if(null!==t&&t!==s)throw Error("You cannot use different slug names for the same dynamic path ('"+t+"' !== '"+s+"').");r.forEach(t=>{if(t===s)throw Error('You cannot have the same slug name "'+s+'" repeat within a single dynamic path');if(t.replace(/\W/g,"")===n.replace(/\W/g,""))throw Error('You cannot have the slug names "'+t+'" and "'+s+'" differ only by non-word symbols within a single dynamic path')}),r.push(s)}if(s){if(o){if(null!=this.restSlugName)throw Error('You cannot use both an required and optional catch-all route at the same level ("[...'+this.restSlugName+']" and "'+t[0]+'" ).');a(this.optionalRestSlugName,i),this.optionalRestSlugName=i,n="[[...]]"}else{if(null!=this.optionalRestSlugName)throw Error('You cannot use both an optional and required catch-all route at the same level ("[[...'+this.optionalRestSlugName+']]" and "'+t[0]+'").');a(this.restSlugName,i),this.restSlugName=i,n="[...]"}}else{if(o)throw Error('Optional route parameters are not yet supported ("'+t[0]+'").');a(this.slugName,i),this.slugName=i,n="[]"}}this.children.has(n)||this.children.set(n,new sh),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 sy(t){let r=new sh;return t.forEach(t=>r.insert(t)),r.smoosh()}class sg{constructor(t){this.definition=t,r2(t.pathname)&&(this.dynamic=ev(tU(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 sb extends sg{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 sD{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 t$;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=sy(B),u=[];for(let t of l){let r=o.get(t);if(!Array.isArray(r))throw Error("Invariant: expected to find identity in indexes map");let s=r.map(t=>i[t]);u.push(...s)}if(this.matchers.dynamic=u,this.compilationID!==n)throw Error("Invariant: expected compilation to finish before new matchers were added, possible missing await")}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 sb?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 Error("Invariant: expected routes to have been loaded before match");if(!r2(t=tw(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 sx(t){return t.endsWith("/page")}class sv{constructor(t=[]){this.normalizers=t}push(t){this.normalizers.push(t)}normalize(t){return this.normalizers.reduce((t,r)=>r.normalize(t),t)}}var sE=__webpack_require__("./dist/esm/shared/lib/isomorphic/path.js"),sj=/*#__PURE__*/__webpack_require__.n(sE);class sA{constructor(...t){this.prefix=sj().posix.join(...t)}normalize(t){return sj().posix.join(this.prefix,t)}}function sS(t){let r=/^\/index(\/|$)/.test(t)&&!r2(t)?"/index"+t:"/"===t?"/index":tw(t);{let{posix:t}=__webpack_require__("path"),s=t.normalize(r);if(s!==r)throw new eb("Requested and resolved page mismatch: "+r+" "+s)}return r}class sP extends sA{constructor(){super("app")}normalize(t){return super.normalize(sS(t))}}class s_ extends sA{constructor(t){super(t,eG)}normalize(t){return super.normalize(t)}}let sw={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"]}},sI=["js","jsx","ts","tsx"],sO=(t,r)=>r?`(?:\\.(${t.join("|")})|((\\[\\])?\\.(${r.join("|")})))`:`\\.(?:${t.join("|")})`;function sT(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(`[\\\\/]${sw.icon.filename}\\d?${s?`${sO(sw.icon.extensions,r)}$`:""}`),RegExp(`[\\\\/]${sw.apple.filename}\\d?${s?`${sO(sw.apple.extensions,r)}$`:""}`),RegExp(`[\\\\/]${sw.openGraph.filename}\\d?${s?`${sO(sw.openGraph.extensions,r)}$`:""}`),RegExp(`[\\\\/]${sw.twitter.filename}\\d?${s?`${sO(sw.twitter.extensions,r)}$`:""}`)],a=r7(t);return n.some(t=>t.test(a))}function sN(t){let r=t.replace(/^\/?app\//,"").replace(/\/route$/,"");return"/"!==r[0]&&(r="/"+r),!r.endsWith("/page")&&sT(r,sI,!1)}function sF(t){return{normalize:t}}class sk{normalize(t){return t.replace(/%5F/g,"_")}}class sM extends sv{constructor(){super([sF(tO),new sk])}normalize(t){return super.normalize(t)}}class sL{constructor(t){this.filename=new s_(t),this.pathname=new sM,this.bundlePath=new sP}}class sR extends sg{get identity(){return`${this.definition.pathname}?__nextPage=${this.definition.page}`}}class sH{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 sG extends sH{constructor(t,r){super({load:async()=>r.load(t),compare:(t,r)=>t===r})}}class sK extends sG{constructor(t,r){super(eN,r),this.normalizers=new sL(t)}async transform(t){let r=Object.keys(t).filter(t=>sx(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:rK.APP_PAGE,pathname:r,page:s,bundlePath:o,filename:i,appPaths:a}))}return n}}function sJ(t){return t.endsWith("/route")}class sU extends sg{}class sQ extends sG{constructor(t,r){super(eN,r),this.normalizers=new sL(t)}async transform(t){let r=Object.keys(t).filter(t=>sJ(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 sU({kind:rK.APP_ROUTE,pathname:a,page:n,bundlePath:i,filename:r}))}return s}}function sW(t){return"/api"===t||!!(null==t?void 0:t.startsWith("/api/"))}class sV extends sg{}class sq extends sb{}class sY extends sv{constructor(){super([sF(sS),new sA("pages")])}normalize(t){return super.normalize(t)}}class sX extends sA{constructor(t){super(t,eG)}normalize(t){return super.normalize(t)}}class sz{constructor(t){this.filename=new sX(t),this.bundlePath=new sY}}class sZ extends sG{constructor(t,r,s){super(eT,r),this.i18nProvider=s,this.normalizers=new sz(t)}async transform(t){let r=Object.keys(t).filter(t=>sW(t)),s=[];for(let n of r)if(this.i18nProvider){let{detectedLocale:r,pathname:a}=this.i18nProvider.analyze(n);s.push(new sq({kind:rK.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 sV({kind:rK.PAGES_API,pathname:n,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(t[n])}));return s}}class s$ extends sg{}class s1 extends sb{}class s0 extends sG{constructor(t,r,s){super(eT,r),this.i18nProvider=s,this.normalizers=new sz(t)}async transform(t){let r=Object.keys(t).filter(t=>!sW(t)).filter(t=>{var r;let s=(null==(r=this.i18nProvider)?void 0:r.analyze(t).pathname)??t;return!eJ.includes(s)}),s=[];for(let n of r)if(this.i18nProvider){let{detectedLocale:r,pathname:a}=this.i18nProvider.analyze(n);s.push(new s1({kind:rK.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 s$({kind:rK.PAGES,pathname:n,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(t[n])}));return s}}class s2{constructor(t){this.getter=t}load(t){return this.getter(t)}}class s3{constructor(t){var r;if(this.config=t,!t.locales.length)throw Error("Invariant: No locales provided");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 Error(`Invariant: The detected locale does not match the locale in the query. Expected to find '${s}' in '${t}' but found '${r.detectedLocale}'}`);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 s5(t,r,s,n){if(rP(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("x-middleware-set-cookie"!==s.toLowerCase()){if("set-cookie"===s.toLowerCase())for(let n of rr(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 rH(s.body,o,n):o.end()}}let s4=se("/_next/data/:path*");function s6(t){return"string"==typeof t&&s4(t)}function s7(t,r){return void 0===r&&(r=""),t=t.replace(/\\/g,"/"),(t=r&&t.endsWith(r)?t.slice(0,-r.length):t).startsWith("/index/")&&!r2(t)?t=t.slice(6):"/index"===t&&(t="/"),t}function s9(t,r){return t.replace(RegExp("([/#?]"+(r?"|%(2f|23|3f|5c)":"")+")","gi"),t=>encodeURIComponent(t))}function s8(t){return t.split("/").map(t=>{try{t=s9(decodeURIComponent(t),!0)}catch(t){throw new eg("Failed to decode path param(s).")}return t}).join("/")}class ne{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 nt extends ne{constructor(){super(e9.RM)}}function nr(t){for(let r of to)delete t[r.toLowerCase()]}function ns(t){return t.definition.kind===rK.APP_ROUTE}function nn(t){return t.definition.kind===rK.APP_PAGE}function na(t){return t.definition.kind===rK.PAGES}class ni extends ne{constructor(){super(e9.pu)}match(t){return t==="/__index"+e9.pu||super.match(t)}normalize(t,r){return t==="/__index"+e9.pu?"/":super.normalize(t,r)}}class no{constructor(t){if(this.prefix=t,t.endsWith("/"))throw Error(`PrefixPathnameNormalizer: prefix "${t}" should not end with a slash`)}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 nB{constructor(t){if(this.suffix=new ne(".json"),!t)throw Error("Invariant: buildID is required");this.prefix=new no(`/_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),r9(t=this.suffix.normalize(t,!0))):t}}function nl(t){let r,s;t.headers instanceof Headers?(r=t.headers.get(tt.toLowerCase())??null,s=t.headers.get("content-type")):(r=t.headers[tt.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 nu(t){return nl(t).isServerAction}function nc(t){return t.replace(/(?:\/index)?\/?$/,"")||"/"}function nd(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=ej(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 np(t){return void 0!==t&&("boolean"==typeof t?t:"incremental"===t)}let nC=Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");class nf{disable(){throw nC}getStore(){}run(){throw nC}exit(){throw nC}enterWith(){throw nC}static bind(t){return t}}let nm="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function nh(){return nm?new nm:new nf}function ny(){let t=globalThis[ng];return null==t?void 0:t.get()}let ng=Symbol.for("@next/request-context");Symbol("response"),Symbol("passThrough"),Symbol("waitUntil");var nb=__webpack_require__("./dist/esm/server/web/spec-extension/adapters/reflect.js");let nD=Symbol("internal response"),nx=new Set([301,302,303,307,308]);function nv(t,r){var s;if(null==t?void 0:null==(s=t.request)?void 0:s.headers){if(!(t.request.headers instanceof Headers))throw Error("request.headers must be an instance of Headers");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 nE extends Response{constructor(t,r={}){super(t,r);let s=this.headers,n=new Proxy(new rE.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 rE.VO&&s.set("x-middleware-set-cookie",i.getAll().map(t=>(0,rE.Ud)(t)).join(",")),nv(r,o),i};default:return nb.l.get(t,n,a)}}});this[nD]={cookies:n,url:r.url?new rb(r.url,{headers:rs(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[nD].cookies}static json(t,r){let s=Response.json(t,r);return new nE(s.body,s)}static redirect(t,r){let s="number"==typeof r?r:(null==r?void 0:r.status)??307;if(!nx.has(s))throw RangeError('Failed to execute "redirect" on "response": Invalid status code');let n="object"==typeof r?r:{},a=new Headers(null==n?void 0:n.headers);return a.set("Location",rn(t)),new nE(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",rn(t)),nv(r,s),new nE(null,{...r,headers:s})}static next(t){let r=new Headers(null==t?void 0:t.headers);return r.set("x-middleware-next","1"),nv(t,r),new nE(null,{...t,headers:r})}}async function nj(){return"_ENTRIES"in globalThis&&_ENTRIES.middleware_instrumentation&&await _ENTRIES.middleware_instrumentation}let nA=null;async function nS(){if("phase-production-build"===process.env.NEXT_PHASE)return;nA||(nA=nj());let t=await nA;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 nP=null;function n_(){return nP||(nP=nS()),nP}function nw(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 nI(t){let r=new Proxy(function(){},{get(r,s){if("then"===s)return{};throw Error(nw(t))},construct(){throw Error(nw(t))},apply(s,n,a){if("function"==typeof a[0])return a[0](r);throw Error(nw(t))}});return new Proxy({},{get:()=>r})}(function(){process!==global.process&&(process.env=global.process.env,global.process=process),Object.defineProperty(globalThis,"__import_unsupported",{value:nI,enumerable:!1,configurable:!1}),n_()})(),__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 nT extends rA{constructor(t){super(t.input,t.init),this.sourcePage=t.page}get request(){throw new rD({page:this.sourcePage})}respondWith(){throw new rD({page:this.sourcePage})}waitUntil(){throw new rD({page:this.sourcePage})}}function nN(t){return t.isOnDemandRevalidate?"on-demand":t.isRevalidate?"stale":void 0}var nF=/*#__PURE__*/function(t){return t.BLOCKING_STATIC_RENDER="BLOCKING_STATIC_RENDER",t.PRERENDER="PRERENDER",t.NOT_FOUND="NOT_FOUND",t}({});function nk(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 Error(`Invalid fallback option: ${t}. Fallback option must be a string, null, undefined, or false.`)}class nM extends Error{}class nL 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[te.toLowerCase()]="1",t.headers[ts.toLowerCase()]="1",eS(t,"isRSCRequest",!0),eS(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[te.toLowerCase()]="1",eS(t,"isRSCRequest",!0);else{if(t.headers["x-now-route-matches"])return nr(t.headers),!1;if("1"!==t.headers[te.toLowerCase()])return!1;eS(t,"isRSCRequest",!0),"1"===t.headers[ts.toLowerCase()]&&eS(t,"isPrefetchRSCRequest",!0)}if(t.url){let r=(0,p.parse)(t.url);r.pathname=s.pathname,t.url=(0,p.format)(r)}return!1},this.handleNextDataRequest=async(t,r,s)=>{let n=this.getMiddleware(),a=s6(s.pathname);if(!a||!a.path)return!1;if(a.path[0]!==this.buildId)return!ej(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=s7(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=em(()=>{tv(`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:d,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=d,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 s3(this.nextConfig.i18n):void 0,this.localeNormalizer=this.i18nProvider?new sm(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&&np(this.nextConfig.experimental.ppr),this.normalizers={rsc:this.enabledDirectories.app?new nt:void 0,prefetchRSC:this.isAppPPREnabled?new ni:void 0,data:this.enabledDirectories.pages?new nB(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,r3.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 s2(t=>{switch(t){case eT:return this.getPagesManifest()??null;case eN:return this.getAppPathsManifest()??null;default:return null}}),r=new sD;return r.push(new s0(this.distDir,t,this.i18nProvider)),r.push(new sZ(this.distDir,t,this.i18nProvider)),this.enabledDirectories.app&&(r.push(new sK(this.distDir,t)),r.push(new sQ(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 nT?Object.fromEntries(s.headers.entries()):s.headers},n))}catch(t){console.error("Error in instrumentation.onRequestError:",t)}}logError(t){this.quiet||tx(t)}async handleRequest(t,r,s){await this.prepare();let n=t.method.toUpperCase(),a=(0,t2.getTracer)();return a.withPropagatedContext(t.headers,()=>a.trace(t3.Li.handleRequest,{spanName:`${n} ${t.url}`,kind:t2.SpanKind.SERVER,attributes:{"http.method":n,"http.target":t.url}},async i=>this.handleRequestImpl(t,r,s).finally(()=>{if(!i)return;let s=ej(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")!==t3.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,d,C,f;await this.matchers.waitTillReady(),nd(t,rP(r)?r.originalResponse:r);let m=(t.url||"").split("?",1)[0];if(null==m?void 0:m.match(/(\\|\/\/)/)){let s=ey(t.url);r.redirect(s,308).body(s).send();return}if(!s||"object"!=typeof s){if(!t.url)throw Error("Invariant: url can not be undefined");s=(0,p.parse)(t.url,!0)}if(!s.pathname)throw Error("Invariant: pathname can't be empty");"string"==typeof s.query&&(s.query=Object.fromEntries(new URLSearchParams(s.query)));let{originalRequest:h=null}=rS(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(rp(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=tf(t.url.replace(/^\/+/,"/")),E=rm(v.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});v.pathname=E.pathname,E.basePath&&(t.url=rf(t.url,this.nextConfig.basePath));let j="string"==typeof t.headers[e9.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[e9.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[e9.gs]&&"POST"===t.method){let r=[];for await(let s of t.body)r.push(s);let s=Buffer.concat(r).toString("utf8");eS(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=r9(n),p=r2(B);if(!p){let t=await this.matchers.match(B,{i18n:o});t&&(B=t.definition.pathname,p=void 0!==t.params)}o&&(n=o.pathname);let C=su({pageIsDynamic:p,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&&eS(t,"rewroteURL",s.pathname);let g=new Set;for(let t of Object.keys(s.query)){let r=s.query[t];ra(t,n=>{s&&(s.query[n]=r,g.add(n),delete s.query[t])})}if(p){let r={},a=C.normalizeDynamicRouteParams(s.query);if(!a.hasValidParams&&!r2(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&&!r2(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"]&&r2(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,eS(t,"didSetDefaultRouteMatches",!0)),r&&(n=C.interpolateDynamicPath(B,r),t.url=C.interpolateDynamicPath(t.url,r))}for(let r of((p||y)&&C.normalizeVercelUrl(t,!0,[...h,...Object.keys((null==(d=C.defaultRouteRegex)?void 0:d.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 eg||s instanceof eb)return r.statusCode=400,this.renderError(null,t,r,"/_error",{});throw s}if(eS(t,"isLocaleDomain",!!D),E.locale&&(t.url=(0,p.format)(v),eS(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&&!ej(t,"incrementalCache")){let r="https:";try{r=new URL(ej(t,"initURL")||"/","http://n").protocol}catch{}let s=await this.getIncrementalCache({requestHeaders:Object.assign({},t.headers),requestProtocol:r.substring(0,r.length-1)}),n=globalThis;if(n.__nextCacheHandlers){let r=(null==(C=t.headers[e9.vS])?void 0:C.split(","))||[];for(let t of Object.values(n.__nextCacheHandlers))"function"==typeof t.receiveExpiredTags&&await t.receiveExpiredTags(...r)}s.resetRequestCache(),eS(t,"incrementalCache",s),globalThis.__incrementalCache=s}ej(t,"serverComponentsHmrCache")||eS(t,"serverComponentsHmrCache",this.getServerComponentsHmrCache());let A=ej(t,"invokePath");if(!j&&A){let n=ej(t,"invokeStatus");if(n){let a=ej(t,"invokeQuery");a&&Object.assign(s.query,a),r.statusCode=n;let i=ej(t,"invokeError")||null;return this.renderError(i,t,r,"/_error",s.query)}let a=new URL(A||"/","http://n"),i=rm(a.pathname,{nextConfig:this.nextConfig,parseData:!1});i.locale&&(s.query.__nextLocale=i.locale),s.pathname!==a.pathname&&(s.pathname=a.pathname,eS(t,"rewroteURL",i.pathname));let o=rC(rf(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=ej(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(ej(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=rf(s.pathname,E.basePath)),r.statusCode=200,await this.run(t,r,s)}catch(s){if(s instanceof nM)throw s;if(s&&"object"==typeof s&&"ERR_INVALID_URL"===s.code||s instanceof eg||s instanceof eb)return r.statusCode=400,this.renderError(null,t,r,"/_error",{});throw s}}getRequestHandlerWithMetadata(t){let r=this.getRequestHandler();return(s,n,a)=>(eA(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,t2.getTracer)().trace(t3.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,t2.getTracer)().trace(t3.Li.pipe,async()=>this.pipeImpl(t,r))}async pipeImpl(t,r){let s=r6(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,t2.getTracer)().trace(t3.Li.render,async()=>this.renderImpl(t,r,s,n,a,i))}getWaitUntil(){let t=ny();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="/"),r5(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:nk(null==(r=this.getPrerenderManifest().dynamicRoutes[t])?void 0:r.fallback)}}async renderToResponseWithComponents(t,r){return(0,t2.getTracer)().trace(t3.Li.renderToResponseWithComponents,async()=>this.renderToResponseWithComponentsImpl(t,r))}pathCouldBeIntercepted(t){return tF(t)||this.interceptionRoutePatterns.some(r=>r.test(t))}setVaryHeader(t,r,s,n){let a=`${te}, ${tr}, ${ts}, ${tn}`,i=ej(t,"isRSCRequest")??!1,o=!1;s&&this.pathCouldBeIntercepted(n)?(r.setHeader("vary",`${a}, ${ta}`),o=!0):(s||i)&&r.setHeader("vary",a),o||delete t.headers[ta]}async renderToResponseWithComponentsImpl({req:t,res:r,pathname:s,renderOpts:n},{components:a,query:i}){var o,B,l,u,c,d,C,f,m,h;let y,g,b,D;s===ew&&(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=nu(t),_=!!(null==(o=a.Component)?void 0:o.getInitialProps),w=!!a.getStaticProps,I=(0,p.parse)(t.url||"").pathname||"/",O=ej(t,"rewroteURL")||I;this.setVaryHeader(t,r,j,O);let T=!1,N=r2(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 Error(`Page "${t}" is missing exported function "generateStaticParams()", which is required with "output: export" config.`);let r=tH(O);if(!y.includes(r))throw Error(`Page "${t}" is missing param "${r}" in "generateStaticParams()", which is required with "output: export" config.`)}T&&(S=!0)}T||(null==y?void 0:y.includes(O))||t.headers["x-now-route-matches"]?w=!0:w||=!!F.routes[nc(s)];let k=!!(i.__nextDataReq||t.headers["x-nextjs-data"]&&this.serverOptions.webServerConfig)&&(w||A),M=ej(t,"isPrefetchRSCRequest")??!1,L=ej(t,"isRSCRequest")??!1;if(!w&&t.headers["x-middleware-prefetch"]&&!(v||"/_error"===s))return r.setHeader(e9.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[e9.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 R=this.isAppPPREnabled&&void 0!==b&&nn(b),H="1"===process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING&&void 0!==i.__nextppronly&&R,G=H&&"fallback"===i.__nextppronly,K=R&&((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?ej(t,"postponed"):void 0,V=K&&L&&!M,q=t.headers[tn.toLowerCase()];if(!v||k||L||(r.statusCode=404),eY.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:rG.fromStatic(a.Component)};if("amp"in i&&!i.amp&&delete i.amp,!0===n.supportsDynamicResponse){let r=r6(t.headers["user-agent"]||""),s="function"!=typeof(null==(d=a.Document)?void 0:d.getInitialProps)||eQ in a.Document;n.supportsDynamicResponse=!w&&!r&&!i.amp&&s,n.isBot=r}!k&&j&&n.dev&&(n.supportsDynamicResponse=!0);let Y=w?null==(l=this.nextConfig.i18n)?void 0:l.defaultLocale:i.__nextDefaultLocale,X=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&&L&&!V&&(!r1(n.runtime)||this.serverOptions.webServerConfig)&&nr(t.headers);let $=!1,ee=!1;w&&({isOnDemandRevalidate:$,revalidateOnlyGenerated:ee}=(0,ez.Gx)(t,this.renderOpts.previewProps)),w&&t.headers[e9.vx]&&(O=I),I=tH(I),O=tH(O),this.localeNormalizer&&(O=this.localeNormalizer.normalize(O));let et=t=>{let s={destination:t.pageProps.__N_REDIRECT,statusCode:t.pageProps.__N_REDIRECT_STATUS,basePath:t.pageProps.__N_REDIRECT_BASE_PATH},n=r$(s),{basePath:a}=this.nextConfig;a&&!1!==s.basePath&&s.destination.startsWith("/")&&(s.destination=`${a}${s.destination}`),s.destination.startsWith("/")&&(s.destination=ey(s.destination)),r.redirect(s.destination,n).body(s.destination).send()};k&&(O=this.stripNextDataPath(O),I=this.stripNextDataPath(I));let er=null;Z||!w||n.supportsDynamicResponse||P||W||V||(er=`${X?`/${X}`:""}${("/"===s||"/"===O)&&X?"":O}${i.amp?".amp":""}`),(v||E)&&w&&(er=`${X?`/${X}`:""}${s}${i.amp?".amp":""}`),er&&(er="/index"===(er=s8(er))&&"/"===s?"/":er);let es="https:";try{es=new URL(ej(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,p.parse)(t.url||"",!0).query;n.params&&Object.keys(n.params).forEach(t=>{delete c[t]});let d="/"!==I&&this.nextConfig.trailingSlash,C=(0,p.format)({pathname:`${O}${d?"/":""}`,query:c}),f={...a,...n,...j?{incrementalCache:en,isRevalidate:w&&!o&&!V,serverActions:this.nextConfig.experimental.serverActions}:{},isNextDataRequest:k,resolvedUrl:C,locale:X,locales:z,defaultLocale:Y,multiZoneDraftMode:this.nextConfig.experimental.multiZoneDraftMode,resolvedAsPath:A||_?(0,p.format)({pathname:`${I}${d?"/":""}`,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(ns(b)){var m;if(!rS(t)||!rP(r))throw Error("Invariant: App Route Route Modules cannot be used in the edge runtime");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=rT.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=rs(n.headers);i&&(r[e9.VC]=i),!r["content-type"]&&t.type&&(r["content-type"]=t.type);let s=void 0!==a.renderOpts.collectedRevalidate&&!(a.renderOpts.collectedRevalidate>=e9.AR)&&a.renderOpts.collectedRevalidate;return{value:{kind:tz.APP_ROUTE,status:n.status,body:Buffer.from(await t.arrayBuffer()),headers:r},revalidate:s,isFallback:!1}}let o=a.renderOpts.pendingWaitUntil;return o&&a.renderOpts.waitUntil&&(a.renderOpts.waitUntil(o),o=void 0),await s5(t,r,n,a.renderOpts.pendingWaitUntil),null}catch(n){if(await this.instrumentationOnRequestError(n,t,{routerKind:"App Router",routePath:s,routeType:"route",revalidateReason:nN(f)}),w)throw n;return tx(n),await s5(t,r,new Response(null,{status:500})),null}}else if(na(b)||nn(b)){if("OPTIONS"===t.method&&!v)return await s5(t,r,new Response(null,{status:400})),null;if(na(b)){f.nextFontManifest=this.nextFontManifest,f.clientReferenceManifest=a.clientReferenceManifest;let o=rS(t)?t.originalRequest:t,B=rP(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:nN({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 Error("Invariant: Unknown route module type")}else l=await this.renderHTML(t,r,s,i,f);let{metadata:h}=l,{headers:y={},fetchTags:g}=h;if(g&&(y[e9.VC]=g),t.fetchMetrics=h.fetchMetrics,j&&w&&0===h.revalidate&&!K){let t=h.staticBailoutInfo,r=Error(`Page changed from static to dynamic at runtime ${I}${(null==t?void 0:t.description)?`, reason: ${t.description}`:""}
|
|
2872
2872
|
see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`);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:tz.REDIRECT,props:h.pageData??h.flightData},revalidate:h.revalidate,isFallback:!1}:l.isNull?null:j?{value:{kind:tz.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:tz.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=nF.NOT_FOUND}g===nF.PRERENDER&&r6(t.headers["user-agent"]||"")&&(g=nF.BLOCKING_STATIC_RENDER),(null==B?void 0:B.isStale)===-1&&($=!0),$&&(g!==nF.NOT_FOUND||B)&&(g=nF.BLOCKING_STATIC_RENDER);let u=er;!u&&n.dev&&j&&(u=s8(O)),u&&i.amp&&(u=u.replace(/\.amp$/,"")),u&&(null==y||y.includes(u)),this.nextConfig.experimental.isExperimentalCompile&&(g=nF.BLOCKING_STATIC_RENDER);let c=$||l||!W?void 0:W;if((J||U)&&void 0!==c)return{revalidate:1,isFallback:!1,value:{kind:tz.PAGES,html:rG.fromStatic(""),pageData:{},headers:void 0,status:void 0}};let d=N&&K&&(ej(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?rK.APP_PAGE:rK.PAGES),incrementalCache:en,isOnDemandRevalidate:$,isPrefetch:"prefetch"===t.headers.purpose,isRoutePPREnabled:K});if(M&&"string"==typeof q){if(null!==eo&&(null==(C=eo.value)?void 0:C.kind)===tz.APP_PAGE&&eo.value.segmentData){let t=eo.value.segmentData.get(q);if(void 0!==t)return{type:"rsc",body:rG.fromStatic(t),revalidate:eo.revalidate}}return r.statusCode=204,K&&r.setHeader(tl,"1"),{type:"rsc",body:rG.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 Error("invariant: cache entry required but not generated");return null}let eB=(null==(c=eo.value)?void 0:c.kind)===tz.APP_PAGE&&"string"==typeof eo.value.postponed;w&&!V&&(!eB||M)&&r.setHeader(tu,"1");let{value:el}=eo;if((null==el?void 0:el.kind)===tz.IMAGE)throw Error("invariant SSG should not return an image cache value");if(W)D=0;else if(L&&!M&&K)D=0;else if(1){if(Z)D=0;else if(w){if(v){let r=ej(t,"notFoundRevalidate");D=void 0===r?0:r}else if(E)D=0;else if("number"==typeof eo.revalidate){if(eo.revalidate<1)throw Error(`Invalid revalidate configuration provided: ${eo.revalidate} < 1`);D=eo.revalidate}else!1===eo.revalidate&&(D=e9.qF)}else r.getHeader("Cache-Control")||(D=0)}eo.revalidate=D;let eu=ej(t,"onCacheEntry");if(eu&&await eu({...eo,value:{...eo.value,kind:(null==(f=eo.value)?void 0:f.kind)===tz.APP_PAGE?"PAGE":null==(m=eo.value)?void 0:m.kind}},{url:ej(t,"initURL")}))return null;if(el){if(el.kind===tz.REDIRECT)return(void 0===eo.revalidate||r.getHeader("Cache-Control")||r.setHeader("Cache-Control",e8({revalidate:eo.revalidate,expireTime:this.nextConfig.expireTime})),k)?{type:"json",body:rG.fromStatic(JSON.stringify(el.props)),revalidate:eo.revalidate}:(await et(el.props),null);if(el.kind===tz.APP_ROUTE){let s=rt(el.headers);return w||s.delete(e9.VC),void 0===eo.revalidate||r.getHeader("Cache-Control")||s.get("Cache-Control")||s.set("Cache-Control",e8({revalidate:eo.revalidate,expireTime:this.nextConfig.expireTime})),await s5(t,r,new Response(el.body,{headers:s,status:el.status||200})),null}if(el.kind===tz.APP_PAGE){if(eB&&W)throw Error("Invariant: postponed state should not be present on a resume request");if(el.headers){let t={...el.headers};for(let[s,n]of(w||delete t[e9.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[e9.VC])&&r.setHeader(e9.VC,el.headers[e9.VC]),!el.status||L&&K||(r.statusCode=el.status),eB&&r.setHeader(tl,"1"),L&&!Z){if(void 0===el.rscData){if(el.postponed)throw Error("Invariant: Expected postponed to be undefined");return{type:"rsc",body:el.html,revalidate:V?0:eo.revalidate}}return{type:"rsc",body:rG.fromStatic(el.rscData),revalidate:eo.revalidate}}return{type:"html",body:el.html,revalidate:eo.revalidate}}return k?{type:"json",body:rG.fromStatic(JSON.stringify(el.pageData)),revalidate:eo.revalidate}:{type:"html",body:el.html,revalidate:eo.revalidate}}return(eS(t,"notFoundRevalidate",eo.revalidate),void 0===eo.revalidate||r.getHeader("Cache-Control")||r.setHeader("Cache-Control",e8({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=r9(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,t2.getTracer)().setRootSpanAttribute("next.route",a);try{return await this.renderToResponseWithComponents(t,l)}catch(s){let t=s instanceof nM;if(!t||t&&r)throw s}}return!1}async renderToResponse(t){return(0,t2.getTracer)().trace(t3.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[tB],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)){ej(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=sf(a);if(a instanceof ex)throw console.error("Invariant: failed to load static page",JSON.stringify({page:i,url:t.req.url,matchedPath:t.req.headers[e9.vx],initUrl:ej(t.req,"initURL"),didRewrite:!!ej(t.req,"rewroteURL"),rewroteUrl:ej(t.req,"rewroteURL")},null,2)),r;if(r instanceof nM&&o)throw r;if(r instanceof eg||r instanceof eb)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 nL;if(!n)throw sp(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,t2.getTracer)().trace(t3.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,t2.getTracer)().trace(t3.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,t2.getTracer)().trace(t3.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:eI,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&&eY.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 nL(Error("missing required error components"));a.components.routeModule?eS(t.req,"match",{definition:a.components.routeModule.definition,params:void 0}):eP(t.req,"match");try{return await this.renderToResponseWithComponents({...t,pathname:B,renderOpts:{...t.renderOpts,err:r}},a)}catch(t){if(t instanceof nM)throw Error("invariant: failed to render error page");throw t}}catch(o){let r=sf(o),a=r instanceof nL;a||this.logError(r),s.statusCode=500;let i=await this.getFallbackErrorComponents(t.req.url);if(i)return eS(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:rG.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,p.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 nH=require("vm");function nG(t){if(Object.isFrozen(t))return t;if(Array.isArray(t)){for(let r of t)r&&"object"==typeof r&&nG(r);return Object.freeze(t)}for(let r of Object.values(t))r&&"object"==typeof r&&nG(r);return Object.freeze(t)}let nK=new Map;function nJ(t,r=!0,s=nK){let n=r&&s.get(t);if(n)return n;let a=JSON.parse((0,f.readFileSync)(t,"utf8"));return r&&(a=nG(a)),r&&s.set(t,a),a}function nU(t,r=!0,s=nK){let n=r&&s.get(t);if(n)return n;let a=(0,f.readFileSync)(t,"utf8");if(0===a.length)throw Error("Manifest file is empty");let i={};return(0,nH.runInNewContext)(a,i),r&&(i=nG(i)),r&&s.set(t,i),i}let nQ=!1,nW=new tm(1e3);function nV(t,r,s,n){let a;let i=`${t}:${r}:${s}:${n}`,o=null==nW?void 0:nW.get(i);if(o)return o;let B=d().join(r,eG);n&&(a=nJ(d().join(B,eN),!nQ));let l=nJ(d().join(B,eT),!nQ);try{t=r9(sS(t))}catch(r){throw console.error(r),new eD(t)}let u=r=>{let n=r[t];if(!r[n]&&s){let a={};for(let t of Object.keys(r))a[rC(t,s).pathname]=l[t];n=a[t]}return n};return(a&&(o=u(a)),o||(o=u(l)),o)?(o=d().join(B,o),null==nW||nW.set(i,o),o):(null==nW||nW.set(i,null),null)}function nq(t,r,s,n){let a=nV(t,r,s,n);if(!a)throw new eD(t);return a}async function nY(t,r,s){let n=nq(t,r,void 0,s);if(n.endsWith(".html"))return f.promises.readFile(n,"utf8").catch(r=>{throw new ex(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 nz(t){return new Promise(r=>setTimeout(r,t))}let nZ=Symbol.for("next.server.action-manifests");function n$({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 n1({serverActionsManifest:t}){return new Proxy({},{get:(r,s)=>{let n;let a=t.node[s].workers,i=V.workAsyncStorage.getStore();if(!(n=i?a[n0(i.page)]:Object.values(a).at(0)))return;let{moduleId:o,async:B}=n;return{id:o,name:s,chunks:[],async:B}}})}function n0(t){return ru(t,"app")?t:"app"+t}async function n2(t,r=3){for(;;)try{return nJ(t)}catch(t){if(--r<=0)throw t;await nz(100)}}async function n3(t,r=3){for(;;)try{return nU(t)}catch(t){if(--r<=0)throw t;await nz(100)}}async function n5(t,r,s){try{return(await n3(t,s)).__RSC_MANIFEST[r]}catch(t){return}}async function n4({distDir:t,page:r,isAppPath:s,isDev:n}){let a={},i={};s||([a,i]=await Promise.all([nY("/_document",t,!1),nY("/_app",t,!1)]));let o=s&&!sN(r),B=n?3:1,[l,u,d,p,C]=await Promise.all([n2((0,c.join)(t,eF),B),n2((0,c.join)(t,eH),B),s?void 0:n2((0,c.join)(t,`${eq}.json`),B).catch(()=>void 0),o?n5((0,c.join)(t,"server","app",r.replace(/%5F/g,"_")+"_"+eW+".js"),r.replace(/%5F/g,"_"),B):void 0,s?n2((0,c.join)(t,"server",eV+".json"),B).catch(()=>null):null]);C&&p&&n$({page:r,clientReferenceManifest:p,serverActionsManifest:C,serverModuleMap:n1({serverActionsManifest:C})});let f=await nY(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:u,dynamicCssManifest:d,pageConfig:f.config||{},ComponentMod:f,getServerSideProps:g,getStaticProps:b,getStaticPaths:D,clientReferenceManifest:p,serverActionsManifest:C,isAppPath:s,page:r,routeModule:x}}let n6=(0,t2.getTracer)().wrap(t3.p2.loadComponents,n4);function n7(t){return(r,s,n)=>{for(let a of t)if(new RegExp(a.regexp).exec(r)&&(!a.has&&!a.missing||sn(s,n,a.has,a.missing)))return!0;return!1}}var n9=__webpack_require__("../next-env/dist/index.js");let n8=require("stream");var ae=/*#__PURE__*/__webpack_require__.n(n8);function at(t,r){for(let s in r){let n=r[s];"function"==typeof n&&(n=n.bind(t)),t[s]=n}return t}function ar(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;at(t,r),r=t}},cloneBodyStream(){let s=r??t,n=new n8.PassThrough,a=new n8.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 as=0,an="x-vercel-cache-tags",aa="x-vercel-sc-headers",ai="x-vercel-cache-state",ao="x-vercel-revalidate",aB="x-vercel-cache-item-name",al="x-vercel-cache-control",au=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;async function ac(t,r,s=0){let n=new AbortController,a=setTimeout(()=>{n.abort()},500);return fetch(t,{...r||{},signal:n.signal}).catch(n=>{if(3!==s)return au&&console.log(`Fetch failed for ${t} retry ${s}`),ac(t,r,s+1);throw n}).finally(()=>{clearTimeout(a)})}class ad{hasMatchingTags(t,r){if(t.length!==r.length)return!1;let s=new Set(t),n=new Set(r);if(s.size!==n.size)return!1;for(let t of s)if(!n.has(t))return!1;return!0}static isAvailable(t){return!!(t._requestHeaders["x-vercel-sc-host"]||process.env.SUSPENSE_CACHE_URL)}constructor(t){if(this.headers={},this.headers["Content-Type"]="application/json",aa in t._requestHeaders){let r=JSON.parse(t._requestHeaders[aa]);for(let t in r)this.headers[t]=r[t];delete t._requestHeaders[aa]}let r=t._requestHeaders["x-vercel-sc-host"]||process.env.SUSPENSE_CACHE_URL,n=t._requestHeaders["x-vercel-sc-basepath"]||process.env.SUSPENSE_CACHE_BASEPATH;if(process.env.SUSPENSE_CACHE_AUTH_TOKEN&&(this.headers.Authorization=`Bearer ${process.env.SUSPENSE_CACHE_AUTH_TOKEN}`),r){let t=process.env.SUSPENSE_CACHE_PROTO||"https";this.cacheEndpoint=`${t}://${r}${n||""}`,au&&console.log("using cache endpoint",this.cacheEndpoint)}else au&&console.log("no cache endpoint available");t.maxMemoryCacheSize?s||(au&&console.log("using memory store for fetch cache"),s=new tm(t.maxMemoryCacheSize,function({value:t}){var r;if(!t)return 25;if(t.kind===tz.REDIRECT)return JSON.stringify(t.props).length;if(t.kind===tz.IMAGE)throw Error("invariant image should not be incremental-cache");return t.kind===tz.FETCH?JSON.stringify(t.data||"").length:t.kind===tz.APP_ROUTE?t.body.length:t.html.length+((null==(r=JSON.stringify(t.kind===tz.APP_PAGE?t.rscData:t.pageData))?void 0:r.length)||0)})):au&&console.log("not using memory store for fetch cache")}resetRequestCache(){null==s||s.reset()}async revalidateTag(...t){let[r]=t;if(r="string"==typeof r?[r]:r,au&&console.log("revalidateTag",r),r.length){if(Date.now()<as){au&&console.log("rate limited ",as);return}for(let t=0;t<Math.ceil(r.length/64);t++){let s=r.slice(64*t,64*t+64);try{let t=await ac(`${this.cacheEndpoint}/v1/suspense-cache/revalidate?tags=${s.map(t=>encodeURIComponent(t)).join(",")}`,{method:"POST",headers:this.headers,next:{internal:!0}});if(429===t.status){let r=t.headers.get("retry-after")||"60000";as=Date.now()+parseInt(r)}if(!t.ok)throw Error(`Request failed with status ${t.status}.`)}catch(t){console.warn("Failed to revalidate tag",s,t)}}}}async get(...t){var r;let[n,a]=t,{tags:i,softTags:o,kind:B,fetchIdx:l,fetchUrl:u}=a;if(B!==tZ.FETCH)return null;if(Date.now()<as)return au&&console.log("rate limited"),null;let c=null==s?void 0:s.get(n),d=(null==c?void 0:null==(r=c.value)?void 0:r.kind)===tz.FETCH&&this.hasMatchingTags(i??[],c.value.tags??[]);if(this.cacheEndpoint&&(!c||!d))try{let t=Date.now(),r={internal:!0,fetchType:"cache-get",fetchUrl:u,fetchIdx:l},a=await fetch(`${this.cacheEndpoint}/v1/suspense-cache/${n}`,{method:"GET",headers:{...this.headers,[aB]:u,[an]:(null==i?void 0:i.join(","))||"",[e9.cS]:(null==o?void 0:o.join(","))||""},next:r});if(429===a.status){let t=a.headers.get("retry-after")||"60000";as=Date.now()+parseInt(t)}if(404===a.status)return au&&console.log(`no fetch cache entry for ${n}, duration: ${Date.now()-t}ms`),null;if(!a.ok)throw console.error(await a.text()),Error(`invalid response from cache ${a.status}`);let B=await a.json();if(!B||B.kind!==tz.FETCH)throw au&&console.log({cached:B}),Error("invalid cache value");if(B.kind===tz.FETCH)for(let t of(B.tags??=[],i??[]))B.tags.includes(t)||B.tags.push(t);let d=a.headers.get(ai),p=a.headers.get("age");c={value:B,lastModified:"fresh"!==d?Date.now()-e9.qF:Date.now()-1e3*parseInt(p||"0",10)},au&&console.log(`got fetch cache entry for ${n}, duration: ${Date.now()-t}ms, size: ${Object.keys(B).length}, cache-state: ${d} tags: ${null==i?void 0:i.join(",")} softTags: ${null==o?void 0:o.join(",")}`),c&&(null==s||s.set(n,c))}catch(t){au&&console.error("Failed to get from fetch-cache",t)}return c||null}async set(...t){let[r,n,a]=t,{fetchCache:i,fetchIdx:o,fetchUrl:B,tags:l}=a;if(i){if(Date.now()<as){au&&console.log("rate limited");return}if(null==s||s.set(r,{value:n,lastModified:Date.now()}),this.cacheEndpoint)try{let t=Date.now();null!==n&&"revalidate"in n&&(this.headers[ao]=n.revalidate.toString()),!this.headers[ao]&&null!==n&&"data"in n&&(this.headers[al]=n.data.headers["cache-control"]);let s=JSON.stringify({...n,tags:void 0});au&&console.log("set cache",r);let a={internal:!0,fetchType:"cache-set",fetchUrl:B,fetchIdx:o},i=await fetch(`${this.cacheEndpoint}/v1/suspense-cache/${r}`,{method:"POST",headers:{...this.headers,[aB]:B||"",[an]:(null==l?void 0:l.join(","))||""},body:s,next:a});if(429===i.status){let t=i.headers.get("retry-after")||"60000";as=Date.now()+parseInt(t)}if(!i.ok)throw au&&console.log(await i.text()),Error(`invalid response ${i.status}`);au&&console.log(`successfully set to fetch-cache for ${r}, duration: ${Date.now()-t}ms, size: ${s.length}`)}catch(t){au&&console.error("Failed to update fetch cache",t)}}}}let ap=require("next/dist/server/lib/incremental-cache/tags-manifest.external.js");class aC{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?n||(this.debug&&console.log("using memory store for fetch cache"),n=new tm(t.maxMemoryCacheSize,function({value:t}){var r;if(!t)return 25;if(t.kind===tz.REDIRECT)return JSON.stringify(t.props).length;if(t.kind===tz.IMAGE)throw Error("invariant image should not be incremental-cache");return t.kind===tz.FETCH?JSON.stringify(t.data||"").length:t.kind===tz.APP_ROUTE?t.body.length:t.html.length+((null==(r=JSON.stringify(t.kind===tz.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=ap.tagsManifest.items[t]||{};r.revalidatedAt=Date.now(),ap.tagsManifest.items[t]=r}}async get(...t){var r,s,a,i,o,B;let[l,u]=t,{tags:c,softTags:d,kind:p,isRoutePPREnabled:C,isFallback:f}=u,m=null==n?void 0:n.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$/,e9.EP),"utf8"));return{lastModified:s.getTime(),value:{kind:tz.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:s}=await this.fs.stat(t);if(p===tZ.FETCH){if(!this.flushToDisk)return null;let t=s.getTime(),n=JSON.parse(r);if(m={lastModified:t,value:n},(null==(i=m.value)?void 0:i.kind)===tz.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 n,a,i;try{n=JSON.parse(await this.fs.readFile(t.replace(/\.html$/,e9.EP),"utf8"))}catch{}if(null==n?void 0:n.segmentPaths){let t=new Map;a=t;let r=l+e9.mH;await Promise.all(n.segmentPaths.map(async s=>{let n=this.getFilePath("/"===s?r+"/_index"+e9.tz:r+s+e9.tz,tZ.APP_PAGE);try{t.set(s,await this.fs.readFile(n))}catch{}}))}f||(i=await this.fs.readFile(this.getFilePath(`${l}${C?e9.pu:e9.RM}`,tZ.APP_PAGE))),m={lastModified:s.getTime(),value:{kind:tz.APP_PAGE,html:r,rscData:i,postponed:null==n?void 0:n.postponed,headers:null==n?void 0:n.headers,status:null==n?void 0:n.status,segmentData:a}}}else if(p===tZ.PAGES){let t;let n={};f||(n=JSON.parse(await this.fs.readFile(this.getFilePath(`${l}${e9.x3}`,tZ.PAGES),"utf8"))),m={lastModified:s.getTime(),value:{kind:tz.PAGES,html:r,pageData:n,headers:null==t?void 0:t.headers,status:null==t?void 0:t.status}}}else throw Error(`Invariant: Unexpected route kind ${p} in file system cache.`);m&&(null==n||n.set(l,m))}catch{return null}}if((null==m?void 0:null==(r=m.value)?void 0:r.kind)===tz.APP_PAGE||(null==m?void 0:null==(s=m.value)?void 0:s.kind)===tz.PAGES){let t;let r=null==(B=m.value.headers)?void 0:B[e9.VC];if("string"==typeof r&&(t=r.split(",")),(null==t?void 0:t.length)&&t.some(t=>{var r;return(null==ap.tagsManifest?void 0:null==(r=ap.tagsManifest.items[t])?void 0:r.revalidatedAt)&&(null==ap.tagsManifest?void 0:ap.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)===tz.FETCH&&[...c||[],...d||[]].some(t=>{var r;return!!this.revalidatedTags.includes(t)||(null==ap.tagsManifest?void 0:null==(r=ap.tagsManifest.items[t])?void 0:r.revalidatedAt)&&(null==ap.tagsManifest?void 0:ap.tagsManifest.items[t].revalidatedAt)>=((null==m?void 0:m.lastModified)||Date.now())})&&(m=void 0);return m??null}async set(...t){let[r,s,a]=t,{isFallback:i}=a;if(null==n||n.set(r,{value:s,lastModified:Date.now()}),this.debug&&console.log("set",r),this.flushToDisk&&s){if(s.kind===tz.APP_ROUTE){let t=this.getFilePath(`${r}.body`,tZ.APP_ROUTE);await this.fs.mkdir(sj().dirname(t)),await this.fs.writeFile(t,s.body);let n={headers:s.headers,status:s.status,postponed:void 0,segmentPaths:void 0};await this.fs.writeFile(t.replace(/\.body$/,e9.EP),JSON.stringify(n,null,2))}else if(s.kind===tz.PAGES||s.kind===tz.APP_PAGE){let t=s.kind===tz.APP_PAGE,n=this.getFilePath(`${r}.html`,t?tZ.APP_PAGE:tZ.PAGES);if(await this.fs.mkdir(sj().dirname(n)),await this.fs.writeFile(n,s.html),i||await this.fs.writeFile(this.getFilePath(`${r}${t?a.isRoutePPREnabled?e9.pu:e9.RM:e9.x3}`,t?tZ.APP_PAGE:tZ.PAGES),t?s.rscData:JSON.stringify(s.pageData)),(null==s?void 0:s.kind)===tz.APP_PAGE){let t={headers:s.headers,status:s.status,postponed:s.postponed,segmentPaths:void 0};await this.fs.writeFile(n.replace(/\.html$/,e9.EP),JSON.stringify(t))}}else if(s.kind===tz.FETCH){let t=this.getFilePath(r,tZ.FETCH);await this.fs.mkdir(sj().dirname(t)),await this.fs.writeFile(t,JSON.stringify({...s,tags:a.tags}))}}}getFilePath(t,r){switch(r){case tZ.FETCH:return sj().join(this.serverDistDir,"..","cache","fetch-cache",t);case tZ.PAGES:return sj().join(this.serverDistDir,"pages",t);case tZ.IMAGE:case tZ.APP_PAGE:case tZ.APP_ROUTE:return sj().join(this.serverDistDir,"app",t);default:throw Error(`Unexpected file path kind: ${r}`)}}}class af{static #e=this.timings=new Map;constructor(t){this.prerenderManifest=t}get(t){var r,s;let n=af.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){af.timings.set(t,r)}clear(){af.timings.clear()}}let am=nh();class ah{constructor({fs:t,dev:r,dynamicIO:s,flushToDisk:n,fetchCache:a,minimalMode:i,serverDistDir:o,requestHeaders:B,requestProtocol:l,maxMemoryCacheSize:u,getPrerenderManifest:c,fetchCacheKeyPrefix:d,CurCacheHandler:p,allowedRevalidateHeaderKeys:C}){var f,m,h,y;this.locks=new Map;let g=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;this.hasCustomCacheHandler=!!p;let b=Symbol.for("@next/cache-handlers"),D=globalThis;if(p)g&&console.log("using custom cache handler",p.name);else{let r=D[b];(null==r?void 0:r.FetchCache)?p=r.FetchCache:(t&&o&&(g&&console.log("using filesystem cache handler"),p=aC),ad.isAvailable({_requestHeaders:B})&&i&&a&&(g&&console.log("using fetch cache handler"),p=ad))}process.env.__NEXT_TEST_MAX_ISR_CACHE&&(u=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=i,this.requestHeaders=B,this.requestProtocol=l,this.allowedRevalidateHeaderKeys=C,this.prerenderManifest=c(),this.revalidateTimings=new af(this.prerenderManifest),this.fetchCacheKeyPrefix=d;let x=[];B[e9.kz]===(null==(m=this.prerenderManifest)?void 0:null==(f=m.preview)?void 0:f.previewModeId)&&(this.isOnDemandRevalidate=!0),i&&"string"==typeof B[e9.vS]&&B[e9.c1]===(null==(y=this.prerenderManifest)?void 0:null==(h=y.preview)?void 0:h.previewModeId)&&(x=B[e9.vS].split(",")),p&&(this.cacheHandler=new p({dev:r,fs:t,flushToDisk:n,serverDistDir:o,revalidatedTags:x,maxMemoryCacheSize:u,_requestHeaders:B,fetchCacheKeyPrefix:d}))}calculateRevalidate(t,r,s,n){if(s)return Math.floor(performance.timeOrigin+performance.now()-1e3);let a=this.revalidateTimings.get(nc(t))??(!n&&1);return"number"==typeof a?1e3*a+r:a}_getPathname(t,r){return r?t:sS(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=am.getStore(),s=r?(0,k.getRenderResumeDataCache)(r):null;if(s){let r=s.fetch.get(t);if((null==r?void 0:r.kind)===tz.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)===tz.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:tz.FETCH,data:s,revalidate:l},revalidateAfter:performance.timeOrigin+performance.now()+1e3*l,isFallback:o}}let c=this.revalidateTimings.get(nc(t));return(null==u?void 0:u.lastModified)===-1?(a=-1,i=-1*e9.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)===tz.FETCH){let s=am.getStore(),n=s?(0,k.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 Error(`Failed to set Next.js data cache, items over 2MB can not be cached (${n} bytes)`);return}try{var a;void 0===s.revalidate||s.fetchCache||this.revalidateTimings.set(nc(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 ay=require("http"),ag=require("https");function ab(t){if(!globalThis.__NEXT_HTTP_AGENT){if(!t)throw Error("Expected config.httpAgentOptions to be an object");globalThis.__NEXT_HTTP_AGENT_OPTIONS=t.httpAgentOptions,globalThis.__NEXT_HTTP_AGENT=new ay.Agent(t.httpAgentOptions),globalThis.__NEXT_HTTPS_AGENT=new ag.Agent(t.httpAgentOptions)}}function aD(t){return t.definition.kind===rK.PAGES_API}let ax={existsSync:m().existsSync,readFile:m().promises.readFile,readFileSync:m().readFileSync,writeFile:(t,r)=>m().promises.writeFile(t,r),mkdir:t=>m().promises.mkdir(t,{recursive:!0}),stat:t=>m().promises.stat(t)};class av extends ae().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 Error("Method not implemented");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 Error("Method not implemented")}get complete(){throw Error("Method not implemented")}get trailers(){throw Error("Method not implemented")}get trailersDistinct(){throw Error("Method not implemented")}get rawTrailers(){throw Error("Method not implemented")}get rawHeaders(){throw Error("Method not implemented.")}setTimeout(){throw Error("Method not implemented.")}}class aE extends ae().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?rt(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 rs(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 Error("Method not implemented.")}writeEarlyHints(){throw Error("Method not implemented.")}get req(){throw Error("Method not implemented.")}assignSocket(){throw Error("Method not implemented.")}detachSocket(){throw Error("Method not implemented.")}writeContinue(){throw Error("Method not implemented.")}writeProcessing(){throw Error("Method not implemented.")}get upgrading(){throw Error("Method not implemented.")}get chunkedEncoding(){throw Error("Method not implemented.")}get shouldKeepAlive(){throw Error("Method not implemented.")}get useChunkedEncodingByDefault(){throw Error("Method not implemented.")}get sendDate(){throw Error("Method not implemented.")}setTimeout(){throw Error("Method not implemented.")}addTrailers(){throw Error("Method not implemented.")}setHeaders(){throw Error("Method not implemented.")}}function aj({url:t,headers:r={},method:s="GET",bodyReadable:n,resWriter:a,socket:i=null}){return{req:new av({url:t,headers:r,method:s,socket:i,readable:n}),res:new aE({socket:i,resWriter:a})}}class aA{async load(t){return await require(t)}}class aS{static async load(t,r=new aA){let s=await r.load(t);if("routeModule"in s)return s.routeModule;throw Error(`Module "${t}" does not export a routeModule.`)}}let aP=(t,r)=>{let s=d().isAbsolute(r)?r:d().join(t,r);return(0,p.pathToFileURL)(s).toString()};function a_(t){var r,s;return(null==(s=t.has)?void 0:null==(r=s[0])?void 0:r.key)===ta}class aw{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 aI=t=>import(t).then(t=>t.default||t),aO=require,aT=new WeakMap;function aN(t){let r=aT.get(t);if(r)return r;if(!Array.isArray(t.matchers))throw Error(`Invariant: invalid matchers for middleware ${JSON.stringify(t)}`);let s=n7(t.matchers);return aT.set(t,s),s}class aF extends nR{constructor(t){super(t),this.registeredInstrumentation=!1,this.cleanupListeners=new aw,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 Error("Invariant: pathname is undefined");a._nextBubbleNoFallback="1";try{var i;n=tH(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(eS(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[tB];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(aD(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 nM)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=ej(t,"middlewareInvoke");if(!a)return!1;let i=()=>(eS(t,"middlewareInvoke",!0),r.body("").send(),!0),o=this.getMiddleware();if(!o)return i();let B=tf(ej(t,"initURL")),l=rm(B.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});B.pathname=l.pathname;let u=tH(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,new t2.BubbledError(!0,n);for(let[t,s]of Object.entries(rs(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 rH(n.response.body,t):t.end(),!0}}catch(a){if(c)throw a;if(sp(a)&&"ENOENT"===a.code)return await this.render404(t,r,s),!0;if(a instanceof eg)return r.statusCode=400,await this.renderError(a,t,r,s.pathname||""),!0;let n=sf(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||(n6({distDir:this.distDir,page:"/_document",isAppPath:!1,isDev:this.isDev}).catch(()=>{}),n6({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=tU(t.page);return{match:ev(r),page:t.page,re:r.re}})}ab(this.nextConfig),this.middlewareManifestPath=(0,c.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 n6({distDir:this.distDir,page:t,isAppPath:!1,isDev:this.isDev}).catch(()=>{});for(let r of Object.keys(t||{}))await n6({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 aO((0,c.resolve)(this.serverOptions.dir||".",this.serverOptions.conf.distDir,"server",e9.Hw))}catch(t){if("MODULE_NOT_FOUND"!==t.code)throw Error("An error occurred while loading the instrumentation hook",{cause:t})}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,n9.loadEnvConfig)(this.dir,t,s?{info:()=>{},error:()=>{}}:l,r)}async getIncrementalCache({requestHeaders:t,requestProtocol:r}){let s;let n=!1,{cacheHandler:a}=this.nextConfig;a&&(s=nX(await aI(aP(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 aI(aP(this.distDir,i[t]))));return new ah({fs:this.getCacheFilesystem(),dev:n,requestHeaders:t,requestProtocol:r,dynamicIO:!!this.nextConfig.experimental.dynamicIO,allowedRevalidateHeaderKeys:this.nextConfig.experimental.allowedRevalidateHeaderKeys,minimalMode:!0,serverDistDir:this.serverDistDir,fetchCache:!0,fetchCacheKeyPrefix:this.nextConfig.experimental.fetchCacheKeyPrefix,maxMemoryCacheSize:this.nextConfig.cacheMaxMemorySize,flushToDisk:!1,getPrerenderManifest:()=>this.getPrerenderManifest(),CurCacheHandler:s})}getResponseCache(){return new rW(!0)}getPublicDir(){return(0,c.join)(this.dir,eU)}getHasStaticDir(){return m().existsSync((0,c.join)(this.dir,"static"))}getPagesManifest(){return nJ((0,c.join)(this.serverDistDir,eT))}getAppPathsManifest(){if(this.enabledDirectories.app)return nJ((0,c.join)(this.serverDistDir,eN))}getinterceptionRoutePatterns(){if(!this.enabledDirectories.app)return[];let t=this.getRoutesManifest();return(null==t?void 0:t.rewrites.beforeFiles.filter(a_).map(t=>new RegExp(t.regex)))??[]}async hasPage(t){var r;return!!nV(t,this.distDir,null==(r=this.nextConfig.i18n)?void 0:r.locales,this.enabledDirectories.app)}getBuildId(){let t=(0,c.join)(this.distDir,eK);try{return m().readFileSync(t,"utf8").trim()}catch(t){if("ENOENT"===t.code)throw 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`);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 td({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 aS.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,t2.getTracer)().trace(t3.Fx.renderHTML,async()=>this.renderHTMLImpl(t,r,s,n,a))}async renderHTMLImpl(t,r,s,n,a){throw Error("Invariant: renderHTML should not be called in minimal mode")}async imageOptimizer(t,r,s,n){throw Error("invariant: imageOptimizer should not be called in minimal mode")}getPagePath(t,r){return nq(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,t2.getTracer)().trace(t3.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):sS(t))+".amp"),r.__nextLocale&&i.unshift(...i.map(t=>`/${r.__nextLocale}${"/"===t?"":t}`)),i))try{let t=await n6({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 eD))throw t}return null}getNextFontManifest(){return nJ((0,c.join)(this.distDir,"server",ek+".json"))}logErrorWithOriginalStack(t,r){throw Error("Invariant: logErrorWithOriginalStack can only be called on the development server")}async ensurePage(t){throw Error("Invariant: ensurePage can only be called on the development server")}async handleApiRequest(t,r,s,n){return this.runApi(t,r,s,n)}getCacheFilesystem(){return ax}normalizeReq(t){return t instanceof e2?t:new e2(t)}normalizeRes(t){return t instanceof e3?t:new e3(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=aj({url:t,headers:r}),a=this.getRequestHandler();if(await a(new e2(n.req),new e3(n.res)),await n.res.hasStreamed,"REVALIDATED"!==n.res.getHeader("x-nextjs-cache")&&!(404===n.res.statusCode&&s.unstable_onlyGenerated))throw Error(`Invalid response ${n.res.statusCode}`)}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(eI)?(await this.runEdgeFunction({req:s,res:n,query:a||{},params:{},page:eI,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:aN(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=r9(sS(t.page))}catch(t){return null}let n=t.middleware?s.middleware[r]:s.functions[r];if(!n){if(!t.middleware)throw new eD(r);return null}return{name:n.name,paths:n.files.map(t=>(0,c.join)(this.distDir,t)),wasm:(n.wasm??[]).map(t=>({...t,filePath:(0,c.join)(this.distDir,t.filePath)})),assets:n.assets&&n.assets.map(t=>({...t,filePath:(0,c.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 Error("invariant: runMiddleware should not be called in minimal mode")}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=nJ((0,c.join)(this.distDir,eM))),this._cachedPreviewManifest}getRoutesManifest(){return(0,t2.getTracer)().trace(t3.Fx.getRoutesManifest,()=>{let t=nJ((0,c.join)(this.distDir,eL)),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;eS(t,"initURL",i),eS(t,"initQuery",{...r.query}),eS(t,"initProtocol",a),s||eS(t,"clonableBody",ar(t.originalRequest))}async runEdgeFunction(t){throw Error("Middleware is not supported in minimal mode. Please remove the `NEXT_MINIMAL` environment variable.")}get serverDistDir(){if(this._serverDistDir)return this._serverDistDir;let t=(0,c.join)(this.distDir,eG);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 new es("createInternalWaitUntil should never be called in minimal mode")}}})(),module.exports=__webpack_exports__})();
|