next 15.6.0-canary.11 → 15.6.0-canary.13
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.
- package/dist/bin/next +1 -1
- package/dist/build/index.js +3 -3
- package/dist/build/swc/index.js +1 -1
- package/dist/build/templates/app-page.js +2 -2
- package/dist/build/templates/app-page.js.map +1 -1
- package/dist/build/templates/app-route.js +2 -2
- package/dist/build/templates/app-route.js.map +1 -1
- package/dist/build/templates/edge-ssr-app.js +2 -2
- package/dist/build/templates/edge-ssr-app.js.map +1 -1
- package/dist/build/templates/edge-ssr.js +2 -2
- package/dist/build/templates/edge-ssr.js.map +1 -1
- package/dist/build/templates/pages-api.js +2 -2
- package/dist/build/templates/pages-api.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-devtools/index.js +15 -15
- package/dist/compiled/next-devtools/index.js.map +1 -1
- package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js.map +1 -1
- package/dist/compiled/next-server/pages-turbo.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages-turbo.runtime.prod.js.map +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 +3 -3
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/templates/app-page.js +2 -2
- package/dist/esm/build/templates/app-page.js.map +1 -1
- package/dist/esm/build/templates/app-route.js +2 -2
- package/dist/esm/build/templates/app-route.js.map +1 -1
- package/dist/esm/build/templates/edge-ssr-app.js +2 -2
- package/dist/esm/build/templates/edge-ssr-app.js.map +1 -1
- package/dist/esm/build/templates/edge-ssr.js +2 -2
- package/dist/esm/build/templates/edge-ssr.js.map +1 -1
- package/dist/esm/build/templates/pages-api.js +2 -2
- package/dist/esm/build/templates/pages-api.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/server/base-server.js +2 -1
- package/dist/esm/server/base-server.js.map +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/experimental/create-env-definitions.js +1 -2
- package/dist/esm/server/lib/experimental/create-env-definitions.js.map +1 -1
- package/dist/esm/server/lib/router-utils/setup-dev-bundler.js +106 -107
- package/dist/esm/server/lib/router-utils/setup-dev-bundler.js.map +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/esm/server/next-server.js +4 -5
- package/dist/esm/server/next-server.js.map +1 -1
- package/dist/esm/shared/lib/canary-only.js +1 -1
- package/dist/server/base-server.d.ts +1 -1
- package/dist/server/base-server.js +2 -1
- package/dist/server/base-server.js.map +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/experimental/create-env-definitions.js +1 -2
- package/dist/server/lib/experimental/create-env-definitions.js.map +1 -1
- package/dist/server/lib/router-utils/setup-dev-bundler.js +106 -107
- package/dist/server/lib/router-utils/setup-dev-bundler.js.map +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/server/next-server.d.ts +2 -3
- package/dist/server/next-server.js +4 -5
- package/dist/server/next-server.js.map +1 -1
- package/dist/shared/lib/canary-only.js +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
@@ -10,5 +10,5 @@
|
|
10
10
|
`)}}class rs extends Error{constructor(){super(`The request.ua has been removed in favour of \`userAgent\` function.
|
11
11
|
Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
|
12
12
|
`)}}var ra=r("./dist/compiled/@edge-runtime/cookies/index.js");let ro=Symbol("internal request");class rl extends Request{constructor(e,t={}){let r="string"!=typeof e&&"url"in e?e.url:String(e);tY(r),t.body&&"half"!==t.duplex&&(t.duplex="half"),e instanceof Request?super(e,t):super(r,t);let n=new rr(r,{headers:tK(this.headers),nextConfig:t.nextConfig});this[ro]={cookies:new ra.RequestCookies(this.headers),nextUrl:n,url:process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE?r: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[ro].cookies}get nextUrl(){return this[ro].nextUrl}get page(){throw new ri}get ua(){throw new rs}get url(){return this[ro].url}}let rd="ResponseAborted";class ru extends Error{constructor(...e){super(...e),this.name=rd}}class rc{constructor(){let e,t;this.promise=new Promise((r,n)=>{e=r,t=n}),this.resolve=e,this.reject=t}}var rh=function(e){return e.handleRequest="BaseServer.handleRequest",e.run="BaseServer.run",e.pipe="BaseServer.pipe",e.getStaticHTML="BaseServer.getStaticHTML",e.render="BaseServer.render",e.renderToResponseWithComponents="BaseServer.renderToResponseWithComponents",e.renderToResponse="BaseServer.renderToResponse",e.renderToHTML="BaseServer.renderToHTML",e.renderError="BaseServer.renderError",e.renderErrorToResponse="BaseServer.renderErrorToResponse",e.renderErrorToHTML="BaseServer.renderErrorToHTML",e.render404="BaseServer.render404",e}(rh||{}),rp=function(e){return e.loadDefaultErrorComponents="LoadComponents.loadDefaultErrorComponents",e.loadComponents="LoadComponents.loadComponents",e}(rp||{}),rf=function(e){return e.compression="NextNodeServer.compression",e.getBuildId="NextNodeServer.getBuildId",e.createComponentTree="NextNodeServer.createComponentTree",e.clientComponentLoading="NextNodeServer.clientComponentLoading",e.getLayoutOrPageModule="NextNodeServer.getLayoutOrPageModule",e.generateStaticRoutes="NextNodeServer.generateStaticRoutes",e.generateFsStaticRoutes="NextNodeServer.generateFsStaticRoutes",e.generatePublicRoutes="NextNodeServer.generatePublicRoutes",e.generateImageRoutes="NextNodeServer.generateImageRoutes.route",e.sendRenderResult="NextNodeServer.sendRenderResult",e.proxyRequest="NextNodeServer.proxyRequest",e.runApi="NextNodeServer.runApi",e.render="NextNodeServer.render",e.renderHTML="NextNodeServer.renderHTML",e.imageOptimizer="NextNodeServer.imageOptimizer",e.getPagePath="NextNodeServer.getPagePath",e.getRoutesManifest="NextNodeServer.getRoutesManifest",e.findPageComponents="NextNodeServer.findPageComponents",e.getFontManifest="NextNodeServer.getFontManifest",e.getServerComponentManifest="NextNodeServer.getServerComponentManifest",e.getRequestHandler="NextNodeServer.getRequestHandler",e.renderToHTML="NextNodeServer.renderToHTML",e.renderError="NextNodeServer.renderError",e.renderErrorToHTML="NextNodeServer.renderErrorToHTML",e.render404="NextNodeServer.render404",e.startResponse="NextNodeServer.startResponse",e.route="route",e.onProxyReq="onProxyReq",e.apiResolver="apiResolver",e.internalFetch="internalFetch",e}(rf||{});let rm=0,rg=0,ry=0;function rv(e){return(null==e?void 0:e.name)==="AbortError"||(null==e?void 0:e.name)===rd}async function r_(e,t,r){try{let{errored:n,destroyed:i}=t;if(n||i)return;let s=function(e){let t=new AbortController;return e.once("close",()=>{e.writableFinished||t.abort(new ru)}),t}(t),a=function(e,t){let r=!1,n=new rc;function i(){n.resolve()}e.on("drain",i),e.once("close",()=>{e.off("drain",i),n.resolve()});let s=new rc;return e.once("finish",()=>{s.resolve()}),new WritableStream({write:async t=>{if(!r){if(r=!0,"performance"in globalThis&&process.env.NEXT_OTEL_PERFORMANCE_PREFIX){let e=function(e={}){let t=0===rm?void 0:{clientComponentLoadStart:rm,clientComponentLoadTimes:rg,clientComponentLoadCount:ry};return e.reset&&(rm=0,rg=0,ry=0),t}();e&&performance.measure(`${process.env.NEXT_OTEL_PERFORMANCE_PREFIX}:next-client-component-loading`,{start:e.clientComponentLoadStart,end:e.clientComponentLoadStart+e.clientComponentLoadTimes})}e.flushHeaders(),(0,tt.getTracer)().trace(rf.startResponse,{spanName:"start response"},()=>void 0)}try{let r=e.write(t);"flush"in e&&"function"==typeof e.flush&&e.flush(),r||(await n.promise,n=new rc)}catch(t){throw e.end(),Object.defineProperty(Error("failed to write chunk to response",{cause:t}),"__NEXT_ERROR_CODE",{value:"E321",enumerable:!1,configurable:!0})}},abort:t=>{e.writableFinished||e.destroy(t)},close:async()=>{if(t&&await t,!e.writableFinished)return e.end(),s.promise}})}(t,r);await e.pipeTo(a,{signal:s.signal})}catch(e){if(rv(e))return;throw Object.defineProperty(Error("failed to pipe response",{cause:e}),"__NEXT_ERROR_CODE",{value:"E180",enumerable:!1,configurable:!0})}}class rb{static #e=this.EMPTY=new rb(null,{metadata:{},contentType:null});static fromStatic(e,t){return new rb(e,{metadata:{},contentType:t})}constructor(e,{contentType:t,waitUntil:r,metadata:n}){this.response=e,this.contentType=t,this.metadata=n,this.waitUntil=r}assignMetadata(e){Object.assign(this.metadata,e)}get isNull(){return null===this.response}get isDynamic(){return"string"!=typeof this.response}toUnchunkedString(e=!1){if(null===this.response)return"";if("string"!=typeof this.response){if(!e)throw Object.defineProperty(new eh("dynamic responses cannot be unchunked. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E732",enumerable:!1,configurable:!0});return tB(this.readable)}return this.response}get readable(){return null===this.response?new ReadableStream({start(e){e.close()}}):"string"==typeof this.response?tW(this.response):Buffer.isBuffer(this.response)?tX(this.response):Array.isArray(this.response)?function(...e){if(0===e.length)return new ReadableStream({start(e){e.close()}});if(1===e.length)return e[0];let{readable:t,writable:r}=new TransformStream,n=e[0].pipeTo(r,{preventClose:!0}),i=1;for(;i<e.length-1;i++){let t=e[i];n=n.then(()=>t.pipeTo(r,{preventClose:!0}))}let s=e[i];return(n=n.then(()=>s.pipeTo(r))).catch(tH),t}(...this.response):this.response}coerce(){return null===this.response?[]:"string"==typeof this.response?[tW(this.response)]:Array.isArray(this.response)?this.response:Buffer.isBuffer(this.response)?[tX(this.response)]:[this.response]}unshift(e){this.response=this.coerce(),this.response.unshift(e)}push(e){this.response=this.coerce(),this.response.push(e)}async pipeTo(e){try{await this.readable.pipeTo(e,{preventClose:!0}),this.waitUntil&&await this.waitUntil,await e.close()}catch(t){if(rv(t))return void await e.abort(t);throw t}}async pipeToNodeResponse(e){await r_(this.readable,e,this.waitUntil)}}function rx(e){return e.replace(/\\/g,"/")}function rE(e){let t=rx(e);return t.startsWith("/index/")&&!tL(t)?t.slice(6):"/index"!==t?t:"/"}function rw(e,t){let r=[],n=(0,eS.pathToRegexp)(e,r,{delimiter:"/",sensitive:"boolean"==typeof(null==t?void 0:t.sensitive)&&t.sensitive,strict:null==t?void 0:t.strict}),i=(0,eS.regexpToFunction)((null==t?void 0:t.regexModifier)?new RegExp(t.regexModifier(n.source),n.flags):n,r);return(e,n)=>{if("string"!=typeof e)return!1;let s=i(e);if(!s)return!1;if(null==t?void 0:t.removeUnnamedParams)for(let e of r)"number"==typeof e.name&&delete s.params[e.name];return{...n,...s.params}}}let rC=/[|\\{}()[\]^$+*?.-]/,rR=/[|\\{}()[\]^$+*?.-]/g;function rP(e){return rC.test(e)?e.replace(rR,"\\$&"):e}let rT=/^([^[]*)\[((?:\[[^\]]*\])|[^\]]+)\](.*)$/;function rO(e){let t=e.startsWith("[")&&e.endsWith("]");t&&(e=e.slice(1,-1));let r=e.startsWith("...");return r&&(e=e.slice(3)),{key:e,repeat:r,optional:t}}function rS(e,t){let{includeSuffix:r=!1,includePrefix:n=!1,excludeOptionalTrailingSlash:i=!1}=void 0===t?{}:t,{parameterizedRoute:s,groups:a}=function(e,t,r){let n={},i=1,s=[];for(let a of tQ(e).slice(1).split("/")){let e=tD.find(e=>a.startsWith(e)),o=a.match(rT);if(e&&o&&o[2]){let{key:t,optional:r,repeat:a}=rO(o[2]);n[t]={pos:i++,repeat:a,optional:r},s.push("/"+rP(e)+"([^/]+?)")}else if(o&&o[2]){let{key:e,repeat:t,optional:a}=rO(o[2]);n[e]={pos:i++,repeat:t,optional:a},r&&o[1]&&s.push("/"+rP(o[1]));let l=t?a?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)";r&&o[1]&&(l=l.substring(1)),s.push(l)}else s.push("/"+rP(a));t&&o&&o[3]&&s.push(rP(o[3]))}return{parameterizedRoute:s.join(""),groups:n}}(e,r,n),o=s;return i||(o+="(?:/)?"),{re:RegExp("^"+o+"$"),groups:a}}function rI(e){let t,{interceptionMarker:r,getSafeRouteKey:n,segment:i,routeKeys:s,keyPrefix:a,backreferenceDuplicateKeys:o}=e,{key:l,optional:d,repeat:u}=rO(i),c=l.replace(/\W/g,"");a&&(c=""+a+c);let h=!1;(0===c.length||c.length>30)&&(h=!0),isNaN(parseInt(c.slice(0,1)))||(h=!0),h&&(c=n());let p=c in s;a?s[c]=""+a+l:s[c]=l;let f=r?rP(r):"";return t=p&&o?"\\k<"+c+">":u?"(?<"+c+">.+?)":"(?<"+c+">[^/]+?)",d?"(?:/"+f+t+")?":"/"+f+t}function rk(e){return e.replace(/__ESC_COLON_/gi,":")}function rA(e,t,r,n){void 0===r&&(r=[]),void 0===n&&(n=[]);let i={},s=r=>{let n,s=r.key;switch(r.type){case"header":s=s.toLowerCase(),n=e.headers[s];break;case"cookie":n="cookies"in e?e.cookies[r.key]:ti(e.headers)()[r.key];break;case"query":n=t[s];break;case"host":{let{host:t}=(null==e?void 0:e.headers)||{};n=null==t?void 0:t.split(":",1)[0].toLowerCase()}}if(!r.value&&n)return i[function(e){let t="";for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);(n>64&&n<91||n>96&&n<123)&&(t+=e[r])}return t}(s)]=n,!0;if(n){let e=RegExp("^"+r.value+"$"),t=Array.isArray(n)?n.slice(-1)[0].match(e):n.match(e);if(t)return Array.isArray(t)&&(t.groups?Object.keys(t.groups).forEach(e=>{i[e]=t.groups[e]}):"host"===r.type&&t[0]&&(i.host=t[0])),!0}return!1};return!(!r.every(e=>s(e))||n.some(e=>s(e)))&&i}function rj(e,t){if(!e.includes(":"))return e;for(let r of Object.keys(t))e.includes(":"+r)&&(e=e.replace(RegExp(":"+r+"\\*","g"),":"+r+"--ESCAPED_PARAM_ASTERISKS").replace(RegExp(":"+r+"\\?","g"),":"+r+"--ESCAPED_PARAM_QUESTION").replace(RegExp(":"+r+"\\+","g"),":"+r+"--ESCAPED_PARAM_PLUS").replace(RegExp(":"+r+"(?!\\w)","g"),"--ESCAPED_PARAM_COLON"+r));return eN("/"+(e=e.replace(/(:|\*|\?|\+|\(|\)|\{|\})/g,"\\$1").replace(/--ESCAPED_PARAM_PLUS/g,"+").replace(/--ESCAPED_PARAM_COLON/g,":").replace(/--ESCAPED_PARAM_QUESTION/g,"?").replace(/--ESCAPED_PARAM_ASTERISKS/g,"*")),{validate:!1})(t).slice(1)}function rN(e){try{return decodeURIComponent(e)}catch{return e}}let rD=/https?|ftp|gopher|file/;var r$=r("./dist/compiled/superstruct/index.cjs"),rM=r.n(r$);let rZ=rM().enums(["c","ci","oc","d","di"]),rL=rM().union([rM().string(),rM().tuple([rM().string(),rM().string(),rZ])]),rq=rM().tuple([rL,rM().record(rM().string(),rM().lazy(()=>rq)),rM().optional(rM().nullable(rM().string())),rM().optional(rM().nullable(rM().union([rM().literal("refetch"),rM().literal("refresh"),rM().literal("inside-shared-layout"),rM().literal("metadata-only")]))),rM().optional(rM().boolean())]),rU="next-action",rz="next-router-state-tree",rF="next-router-prefetch",rH="next-router-segment-prefetch",rV="next-url",rW=["rsc",rz,rF,"next-hmr-refresh",rH],rX="_rsc";function rB(e){var t,r;return(null==(r=e.has)||null==(t=r[0])?void 0:t.key)===rV}function rG(e,t){for(let r in delete e.nextInternalLocale,e){let n=r!==eQ&&r.startsWith(eQ),i=r!==e0&&r.startsWith(e0);(n||i||t.includes(r))&&delete e[r]}}function rK(e,t){return"string"==typeof e[e7]&&e["x-next-revalidate-tag-token"]===t?e[e7].split(","):[]}function rY(e){return"object"==typeof e&&null!==e&&"name"in e&&"message"in e}function rJ(e){return rY(e)?e:Object.defineProperty(Error(!function(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return null===t||t.hasOwnProperty("isPrototypeOf")}(e)?e+"":function(e){let t=new WeakSet;return JSON.stringify(e,(e,r)=>{if("object"==typeof r&&null!==r){if(t.has(r))return"[Circular]";t.add(r)}return r})}(e)),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}class rQ{constructor(e){this.provider=e}normalize(e){return this.provider.analyze(e).pathname}}class r0{insert(e){this._insert(e.split("/").filter(Boolean),[],!1)}smoosh(){return this._smoosh()}_smoosh(e){void 0===e&&(e="/");let t=[...this.children.keys()].sort();null!==this.slugName&&t.splice(t.indexOf("[]"),1),null!==this.restSlugName&&t.splice(t.indexOf("[...]"),1),null!==this.optionalRestSlugName&&t.splice(t.indexOf("[[...]]"),1);let r=t.map(t=>this.children.get(t)._smoosh(""+e+t+"/")).reduce((e,t)=>[...e,...t],[]);if(null!==this.slugName&&r.push(...this.children.get("[]")._smoosh(e+"["+this.slugName+"]/")),!this.placeholder){let t="/"===e?"/":e.slice(0,-1);if(null!=this.optionalRestSlugName)throw Object.defineProperty(Error('You cannot define a route with the same specificity as a optional catch-all route ("'+t+'" and "'+t+"[[..."+this.optionalRestSlugName+']]").'),"__NEXT_ERROR_CODE",{value:"E458",enumerable:!1,configurable:!0});r.unshift(t)}return null!==this.restSlugName&&r.push(...this.children.get("[...]")._smoosh(e+"[..."+this.restSlugName+"]/")),null!==this.optionalRestSlugName&&r.push(...this.children.get("[[...]]")._smoosh(e+"[[..."+this.optionalRestSlugName+"]]/")),r}_insert(e,t,r){if(0===e.length){this.placeholder=!1;return}if(r)throw Object.defineProperty(Error("Catch-all must be the last part of the URL."),"__NEXT_ERROR_CODE",{value:"E392",enumerable:!1,configurable:!0});let n=e[0];if(n.startsWith("[")&&n.endsWith("]")){let s=n.slice(1,-1),a=!1;if(s.startsWith("[")&&s.endsWith("]")&&(s=s.slice(1,-1),a=!0),s.startsWith("…"))throw Object.defineProperty(Error("Detected a three-dot character ('…') at ('"+s+"'). Did you mean ('...')?"),"__NEXT_ERROR_CODE",{value:"E147",enumerable:!1,configurable:!0});if(s.startsWith("...")&&(s=s.substring(3),r=!0),s.startsWith("[")||s.endsWith("]"))throw Object.defineProperty(Error("Segment names may not start or end with extra brackets ('"+s+"')."),"__NEXT_ERROR_CODE",{value:"E421",enumerable:!1,configurable:!0});if(s.startsWith("."))throw Object.defineProperty(Error("Segment names may not start with erroneous periods ('"+s+"')."),"__NEXT_ERROR_CODE",{value:"E288",enumerable:!1,configurable:!0});function i(e,r){if(null!==e&&e!==r)throw Object.defineProperty(Error("You cannot use different slug names for the same dynamic path ('"+e+"' !== '"+r+"')."),"__NEXT_ERROR_CODE",{value:"E337",enumerable:!1,configurable:!0});t.forEach(e=>{if(e===r)throw Object.defineProperty(Error('You cannot have the same slug name "'+r+'" repeat within a single dynamic path'),"__NEXT_ERROR_CODE",{value:"E247",enumerable:!1,configurable:!0});if(e.replace(/\W/g,"")===n.replace(/\W/g,""))throw Object.defineProperty(Error('You cannot have the slug names "'+e+'" and "'+r+'" differ only by non-word symbols within a single dynamic path'),"__NEXT_ERROR_CODE",{value:"E499",enumerable:!1,configurable:!0})}),t.push(r)}if(r)if(a){if(null!=this.restSlugName)throw Object.defineProperty(Error('You cannot use both an required and optional catch-all route at the same level ("[...'+this.restSlugName+']" and "'+e[0]+'" ).'),"__NEXT_ERROR_CODE",{value:"E299",enumerable:!1,configurable:!0});i(this.optionalRestSlugName,s),this.optionalRestSlugName=s,n="[[...]]"}else{if(null!=this.optionalRestSlugName)throw Object.defineProperty(Error('You cannot use both an optional and required catch-all route at the same level ("[[...'+this.optionalRestSlugName+']]" and "'+e[0]+'").'),"__NEXT_ERROR_CODE",{value:"E300",enumerable:!1,configurable:!0});i(this.restSlugName,s),this.restSlugName=s,n="[...]"}else{if(a)throw Object.defineProperty(Error('Optional route parameters are not yet supported ("'+e[0]+'").'),"__NEXT_ERROR_CODE",{value:"E435",enumerable:!1,configurable:!0});i(this.slugName,s),this.slugName=s,n="[]"}}this.children.has(n)||this.children.set(n,new r0),this.children.get(n)._insert(e.slice(1),t,r)}constructor(){this.placeholder=!0,this.children=new Map,this.slugName=null,this.restSlugName=null,this.optionalRestSlugName=null}}class r1{constructor(e){this.definition=e,tL(e.pathname)&&(this.dynamic=eD(rS(e.pathname)))}get identity(){return this.definition.pathname}get isDynamic(){return void 0!==this.dynamic}match(e){let t=this.test(e);return t?{definition:this.definition,params:t.params}:null}test(e){if(this.dynamic){let t=this.dynamic(e);return t?{params:t}:null}return e===this.definition.pathname?{}:null}}class r4 extends r1{get identity(){var e;return`${this.definition.pathname}?__nextLocale=${null==(e=this.definition.i18n)?void 0:e.locale}`}match(e,t){var r,n;let i=this.test(e,t);return i?{definition:this.definition,params:i.params,detectedLocale:(null==t||null==(r=t.i18n)?void 0:r.detectedLocale)??(null==(n=this.definition.i18n)?void 0:n.locale)}:null}test(e,t){return this.definition.i18n&&(null==t?void 0:t.i18n)?this.definition.i18n.locale&&t.i18n.detectedLocale&&this.definition.i18n.locale!==t.i18n.detectedLocale?null:super.test(t.i18n.pathname):super.test(e)}}class r2{get compilationID(){return this.providers.length}async waitTillReady(){this.waitTillReadyPromise&&(await this.waitTillReadyPromise,delete this.waitTillReadyPromise)}async reload(){let{promise:e,resolve:t,reject:r}=new rc;this.waitTillReadyPromise=e;let n=this.compilationID;try{let e=[],t=await Promise.all(this.providers.map(e=>e.matchers())),r=new Map,i={};for(let n of t)for(let t of n){t.duplicated&&delete t.duplicated;let n=r.get(t.definition.pathname);if(n){let e=i[t.definition.pathname]??[n];e.push(t),i[t.definition.pathname]=e,n.duplicated=e,t.duplicated=e}e.push(t),r.set(t.definition.pathname,t)}if(this.matchers.duplicates=i,this.previousMatchers.length===e.length&&this.previousMatchers.every((t,r)=>t===e[r]))return;this.previousMatchers=e,this.matchers.static=e.filter(e=>!e.isDynamic);let s=e.filter(e=>e.isDynamic),a=new Map,o=[];for(let e=0;e<s.length;e++){let t=s[e].definition.pathname,r=a.get(t)??[];r.push(e),1===r.length&&(a.set(t,r),o.push(t))}let l=function(e){let t=new r0;return e.forEach(e=>t.insert(e)),t.smoosh()}(o),d=[];for(let e of l){let t=a.get(e);if(!Array.isArray(t))throw Object.defineProperty(Error("Invariant: expected to find identity in indexes map"),"__NEXT_ERROR_CODE",{value:"E271",enumerable:!1,configurable:!0});let r=t.map(e=>s[e]);d.push(...r)}if(this.matchers.dynamic=d,this.compilationID!==n)throw Object.defineProperty(Error("Invariant: expected compilation to finish before new matchers were added, possible missing await"),"__NEXT_ERROR_CODE",{value:"E242",enumerable:!1,configurable:!0})}catch(e){r(e)}finally{this.lastCompilationID=n,t()}}push(e){this.providers.push(e)}async test(e,t){return null!==await this.match(e,t)}async match(e,t){for await(let r of this.matchAll(e,t))return r;return null}validate(e,t,r){var n;return t instanceof r4?t.match(e,r):(null==(n=r.i18n)?void 0:n.inferredFromDefault)?t.match(r.i18n.pathname):t.match(e)}async *matchAll(e,t){if(this.lastCompilationID!==this.compilationID)throw Object.defineProperty(Error("Invariant: expected routes to have been loaded before match"),"__NEXT_ERROR_CODE",{value:"E235",enumerable:!1,configurable:!0});if(!tL(e=tA(e)))for(let r of this.matchers.static){let n=this.validate(e,r,t);n&&(yield n)}if(null==t?void 0:t.skipDynamic)return null;for(let r of this.matchers.dynamic){let n=this.validate(e,r,t);n&&(yield n)}return null}constructor(){this.providers=[],this.matchers={static:[],dynamic:[],duplicates:{}},this.lastCompilationID=this.compilationID,this.previousMatchers=[]}}class r9{constructor(e=[]){this.normalizers=e}push(e){this.normalizers.push(e)}normalize(e){return this.normalizers.reduce((e,t)=>t.normalize(e),e)}}var r3=r("./dist/esm/shared/lib/isomorphic/path.js"),r8=r.n(r3);class r5{constructor(...e){this.prefix=r8().posix.join(...e)}normalize(e){return r8().posix.join(this.prefix,e)}}function r6(e){let t=/^\/index(\/|$)/.test(e)&&!tL(e)?"/index"+e:"/"===e?"/index":tA(e);{let{posix:e}=r("path"),n=e.normalize(t);if(n!==t)throw new eC("Requested and resolved page mismatch: "+t+" "+n)}return t}class r7{normalize(e){return e.replace(/%5F/g,"_")}}class ne extends r5{constructor(){super("app")}normalize(e){return super.normalize(r6(e))}}class nt extends r5{constructor(e){super(e,eV)}normalize(e){return super.normalize(e)}}function nr(e){return e.endsWith("/route")}let nn={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"]}},ni=(e,t)=>t&&0!==t.length?`(?:\\.(${e.join("|")})|(\\.(${t.join("|")})))`:`(\\.(?:${e.join("|")}))`;function ns(e){return{normalize:e}}class na extends r9{constructor(){super([ns(tj),new r7])}normalize(e){return super.normalize(e)}}class no{constructor(e){this.filename=new nt(e),this.pathname=new na,this.bundlePath=new ne}}var nl=function(e){return e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE",e}({});class nd extends r1{get identity(){return`${this.definition.pathname}?__nextPage=${this.definition.page}`}}class nu{constructor(e){this.loader=e,this.cached=[]}async matchers(){let e=await this.loader.load();if(!e)return[];if(this.data&&this.loader.compare(this.data,e))return this.cached;this.data=e;let t=await this.transform(e);return this.cached=t,t}}class nc extends nu{constructor(e,t){super({load:async()=>t.load(e),compare:(e,t)=>e===t})}}class nh extends nc{constructor(e,t){super(eH,t),this.normalizers=new no(e)}async transform(e){let t=Object.keys(e).filter(e=>e.endsWith("/page")),r={};for(let e of t){let t=this.normalizers.pathname.normalize(e);t in r?r[t].push(e):r[t]=[e]}let n=[];for(let[t,i]of Object.entries(r)){let r=i[0],s=this.normalizers.filename.normalize(e[r]),a=this.normalizers.bundlePath.normalize(r);n.push(new nd({kind:nl.APP_PAGE,pathname:t,page:r,bundlePath:a,filename:s,appPaths:i}))}return n}}class np extends r1{}class nf extends nc{constructor(e,t){super(eH,t),this.normalizers=new no(e)}async transform(e){let t=Object.keys(e).filter(e=>nr(e)),r=[];for(let n of t){let t=this.normalizers.filename.normalize(e[n]),i=this.normalizers.pathname.normalize(n),s=this.normalizers.bundlePath.normalize(n);r.push(new np({kind:nl.APP_ROUTE,pathname:i,page:n,bundlePath:s,filename:t}))}return r}}function nm(e){return"/api"===e||!!(null==e?void 0:e.startsWith("/api/"))}class ng extends r1{}class ny extends r4{}class nv extends r9{constructor(){super([ns(r6),new r5("pages")])}normalize(e){return super.normalize(e)}}class n_ extends r5{constructor(e){super(e,eV)}normalize(e){return super.normalize(e)}}class nb{constructor(e){this.filename=new n_(e),this.bundlePath=new nv}}class nx extends nc{constructor(e,t,r){super(eF,t),this.i18nProvider=r,this.normalizers=new nb(e)}async transform(e){let t=Object.keys(e).filter(e=>nm(e)),r=[];for(let n of t)if(this.i18nProvider){let{detectedLocale:t,pathname:i}=this.i18nProvider.analyze(n);r.push(new ny({kind:nl.PAGES_API,pathname:i,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(e[n]),i18n:{locale:t}}))}else r.push(new ng({kind:nl.PAGES_API,pathname:n,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(e[n])}));return r}}class nE extends r1{}class nw extends r4{}class nC extends nc{constructor(e,t,r){super(eF,t),this.i18nProvider=r,this.normalizers=new nb(e)}async transform(e){let t=Object.keys(e).filter(e=>!nm(e)).filter(e=>{var t;let r=(null==(t=this.i18nProvider)?void 0:t.analyze(e).pathname)??e;return!eW.includes(r)}),r=[];for(let n of t)if(this.i18nProvider){let{detectedLocale:t,pathname:i}=this.i18nProvider.analyze(n);r.push(new nw({kind:nl.PAGES,pathname:i,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(e[n]),i18n:{locale:t}}))}else r.push(new nE({kind:nl.PAGES,pathname:n,page:n,bundlePath:this.normalizers.bundlePath.normalize(n),filename:this.normalizers.filename.normalize(e[n])}));return r}}class nR{constructor(e){this.getter=e}load(e){return this.getter(e)}}class nP{constructor(e){var t;if(this.config=e,!e.locales.length)throw Object.defineProperty(Error("Invariant: No locales provided"),"__NEXT_ERROR_CODE",{value:"E510",enumerable:!1,configurable:!0});this.lowerCaseLocales=e.locales.map(e=>e.toLowerCase()),this.lowerCaseDomains=null==(t=e.domains)?void 0:t.map(e=>{var t;let r=e.domain.toLowerCase();return{defaultLocale:e.defaultLocale.toLowerCase(),hostname:r.split(":",1)[0],domain:r,locales:null==(t=e.locales)?void 0:t.map(e=>e.toLowerCase()),http:e.http}})}detectDomainLocale(e,t){if(e&&this.lowerCaseDomains&&this.config.domains){t&&(t=t.toLowerCase());for(let n=0;n<this.lowerCaseDomains.length;n++){var r;let i=this.lowerCaseDomains[n];if(i.hostname===e||(null==(r=i.locales)?void 0:r.some(e=>e===t)))return this.config.domains[n]}}}fromRequest(e,t){let r=eM(e,"locale");if(r){let e=this.analyze(t);e.detectedLocale&&(e.detectedLocale!==r&&console.warn(`The detected locale does not match the locale in the query. Expected to find '${r}' in '${t}' but found '${e.detectedLocale}'}`),t=e.pathname)}return{pathname:t,detectedLocale:r,inferredFromDefault:eM(e,"localeInferredFromDefault")??!1}}analyze(e,t={}){let r=t.defaultLocale,n="string"==typeof r,i=e.split("/",2);if(!i[1])return{detectedLocale:r,pathname:e,inferredFromDefault:n};let s=i[1].toLowerCase(),a=this.lowerCaseLocales.indexOf(s);return a<0||(r=this.config.locales[a],n=!1,e=e.slice(r.length+1)||"/"),{detectedLocale:r,pathname:e,inferredFromDefault:n}}}async function nT(e,t,r,n){{var i;t.statusCode=r.status,t.statusMessage=r.statusText;let s=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(i=r.headers)||i.forEach((e,r)=>{if("x-middleware-set-cookie"!==r.toLowerCase())if("set-cookie"===r.toLowerCase())for(let n of tG(e))t.appendHeader(r,n);else{let n=void 0!==t.getHeader(r);(s.includes(r.toLowerCase())||!n)&&t.appendHeader(r,e)}});let{originalResponse:a}=t;r.body&&"HEAD"!==e.method?await r_(r.body,a,n):a.end()}}let nO=rw("/_next/data/:path*");class nS{constructor(e){this.suffix=e}match(e){return!!e.endsWith(this.suffix)}normalize(e,t){return t||this.match(e)?e.substring(0,e.length-this.suffix.length):e}}class nI extends nS{constructor(){super(e3)}}class nk extends nS{constructor(){super(e4)}match(e){return e==="/__index"+e4||super.match(e)}normalize(e,t){return e==="/__index"+e4?"/":super.normalize(e,t)}}class nA{constructor(e){if(this.prefix=e,e.endsWith("/"))throw Object.defineProperty(Error(`PrefixPathnameNormalizer: prefix "${e}" should not end with a slash`),"__NEXT_ERROR_CODE",{value:"E219",enumerable:!1,configurable:!0})}match(e){return e===this.prefix||!!e.startsWith(this.prefix+"/")}normalize(e,t){return t||this.match(e)?e.length===this.prefix.length?"/":e.substring(this.prefix.length):e}}class nj{constructor(e){if(this.suffix=new nS(".json"),!e)throw Object.defineProperty(Error("Invariant: buildID is required"),"__NEXT_ERROR_CODE",{value:"E200",enumerable:!1,configurable:!0});this.prefix=new nA(`/_next/data/${e}`)}match(e){return this.prefix.match(e)&&this.suffix.match(e)}normalize(e,t){return t||this.match(e)?(e=this.prefix.normalize(e,!0),rE(e=this.suffix.normalize(e,!0))):e}}function nN(e){return e.replace(/(?:\/index)?\/?$/,"")||"/"}Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0}),"undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;let nD=Symbol.for("@next/request-context");Symbol("response"),Symbol("passThrough"),Symbol("waitUntil");let n$=Symbol("internal response"),nM=new Set([301,302,303,307,308]);function nZ(e,t){var r;if(null==e||null==(r=e.request)?void 0:r.headers){if(!(e.request.headers instanceof Headers))throw Object.defineProperty(Error("request.headers must be an instance of Headers"),"__NEXT_ERROR_CODE",{value:"E119",enumerable:!1,configurable:!0});let r=[];for(let[n,i]of e.request.headers)t.set("x-middleware-request-"+n,i),r.push(n);t.set("x-middleware-override-headers",r.join(","))}}class nL extends Response{constructor(e,t={}){super(e,t);let r=this.headers,n=new Proxy(new ra.ResponseCookies(r),{get(e,n,i){switch(n){case"delete":case"set":return(...i)=>{let s=Reflect.apply(e[n],e,i),a=new Headers(r);return s instanceof ra.ResponseCookies&&r.set("x-middleware-set-cookie",s.getAll().map(e=>(0,ra.stringifyCookie)(e)).join(",")),nZ(t,a),s};default:return eG.get(e,n,i)}}});this[n$]={cookies:n,url:t.url?new rr(t.url,{headers:tK(r),nextConfig:t.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[n$].cookies}static json(e,t){let r=Response.json(e,t);return new nL(r.body,r)}static redirect(e,t){let r="number"==typeof t?t:(null==t?void 0:t.status)??307;if(!nM.has(r))throw Object.defineProperty(RangeError('Failed to execute "redirect" on "response": Invalid status code'),"__NEXT_ERROR_CODE",{value:"E529",enumerable:!1,configurable:!0});let n="object"==typeof t?t:{},i=new Headers(null==n?void 0:n.headers);return i.set("Location",tY(e)),new nL(null,{...n,headers:i,status:r})}static rewrite(e,t){let r=new Headers(null==t?void 0:t.headers);return r.set("x-middleware-rewrite",tY(e)),nZ(t,r),new nL(null,{...t,headers:r})}static next(e){let t=new Headers(null==e?void 0:e.headers);return t.set("x-middleware-next","1"),nZ(e,t),new nL(null,{...e,headers:t})}}Symbol.for("next.mutated.cookies"),r("./dist/compiled/p-queue/index.js");let nq=require("next/dist/server/lib/cache-handlers/default.external.js");var nU=r.n(nq);let nz=process.env.NEXT_PRIVATE_DEBUG_CACHE?(e,...t)=>{console.log(`use-cache: ${e}`,...t)}:void 0,nF=Symbol.for("@next/cache-handlers"),nH=Symbol.for("@next/cache-handlers-map"),nV=Symbol.for("@next/cache-handlers-set"),nW=globalThis;require("next/dist/server/app-render/after-task-async-storage.external.js");class nX extends rl{constructor(e){super(e.input,e.init),this.sourcePage=e.page}get request(){throw Object.defineProperty(new rn({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}respondWith(){throw Object.defineProperty(new rn({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}waitUntil(){throw Object.defineProperty(new rn({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}}let nB=RegExp(`^(/.*)${e2}(/.*)${e9}$`);class nG{match(e){return nB.test(e)}extract(e){let t=e.match(nB);return t?{originalPathname:t[1],segmentPath:t[2]}:null}normalize(e){let t=this.extract(e);return t?t.originalPathname:e}}let nK=require("next/dist/shared/lib/no-fallback-error.external.js");var nY=r("./dist/compiled/zod/index.cjs");r("./dist/compiled/zod-validation-error/index.js"),nY.z.object({revalidate:nY.z.union([nY.z.number().int().nonnegative(),nY.z.literal(!1)]).optional(),dynamicParams:nY.z.boolean().optional(),dynamic:nY.z.enum(["auto","error","force-static","force-dynamic"]).optional(),fetchCache:nY.z.enum(["auto","default-cache","only-cache","force-cache","force-no-store","default-no-store","only-no-store"]).optional(),unstable_prefetch:nY.z.enum(["unstable_static","unstable_runtime"]).optional(),preferredRegion:nY.z.union([nY.z.string(),nY.z.array(nY.z.string())]).optional(),experimental_ppr:nY.z.boolean().optional(),runtime:nY.z.enum(["edge","nodejs"]).optional(),maxDuration:nY.z.number().int().nonnegative().optional()}).keyof().options;let nJ={catchall:"c","catchall-intercepted":"ci","optional-catchall":"oc",dynamic:"d","dynamic-intercepted":"di"};class nQ extends Error{constructor(e){super(),this.innerError=e}}class n0{getServerComponentsHmrCache(){return this.nextConfig.experimental.serverComponentsHmrCache?globalThis.__serverComponentsHmrCache:void 0}constructor(e){var t,r,n;this.handleRSCRequest=(e,t,r)=>{var n,i,s;if(!r.pathname)return!1;if(null==(n=this.normalizers.segmentPrefetchRSC)?void 0:n.match(r.pathname)){let t=this.normalizers.segmentPrefetchRSC.extract(r.pathname);if(!t)return!1;let{originalPathname:n,segmentPath:i}=t;r.pathname=n,e.headers.rsc="1",e.headers[rF]="1",e.headers[rH]=i,eZ(e,"isRSCRequest",!0),eZ(e,"isPrefetchRSCRequest",!0),eZ(e,"segmentPrefetchRSCRequest",i)}else if(null==(i=this.normalizers.prefetchRSC)?void 0:i.match(r.pathname))r.pathname=this.normalizers.prefetchRSC.normalize(r.pathname,!0),e.headers.rsc="1",e.headers[rF]="1",eZ(e,"isRSCRequest",!0),eZ(e,"isPrefetchRSCRequest",!0);else if(null==(s=this.normalizers.rsc)?void 0:s.match(r.pathname))r.pathname=this.normalizers.rsc.normalize(r.pathname,!0),e.headers.rsc="1",eZ(e,"isRSCRequest",!0);else if(e.headers["x-now-route-matches"]){var a=e.headers;for(let e of rW)delete a[e];return!1}else if("1"!==e.headers.rsc)return!1;else if(eZ(e,"isRSCRequest",!0),"1"===e.headers[rF]){eZ(e,"isPrefetchRSCRequest",!0);let t=e.headers[rH];"string"==typeof t&&eZ(e,"segmentPrefetchRSCRequest",t)}if(e.url){let t=(0,b.parse)(e.url);t.pathname=r.pathname,e.url=(0,b.format)(t)}return!1},this.handleNextDataRequest=async(e,t,r)=>{let n=await this.getMiddleware(),i=function(e){return"string"==typeof e&&nO(e)}(r.pathname);if(!i||!i.path)return!1;if(i.path[0]!==this.buildId)return!eM(e,"middlewareInvoke")&&(await this.render404(e,t,r),!0);i.path.shift();let s=i.path[i.path.length-1];if("string"!=typeof s||!s.endsWith(".json"))return await this.render404(e,t,r),!0;let a=`/${i.path.join("/")}`;if(a=function(e,t){return void 0===t&&(t=""),e=e.replace(/\\/g,"/"),(e=t&&e.endsWith(t)?e.slice(0,-t.length):e).startsWith("/index/")&&!tL(e)?e=e.slice(6):"/index"===e&&(e="/"),e}(a,".json"),n&&(this.nextConfig.trailingSlash&&!a.endsWith("/")&&(a+="/"),!this.nextConfig.trailingSlash&&a.length>1&&a.endsWith("/")&&(a=a.substring(0,a.length-1))),this.i18nProvider){var o;let i=null==e||null==(o=e.headers.host)?void 0:o.split(":",1)[0].toLowerCase(),s=this.i18nProvider.detectDomainLocale(i),l=(null==s?void 0:s.defaultLocale)??this.i18nProvider.config.defaultLocale,d=this.i18nProvider.analyze(a);if(d.detectedLocale&&(a=d.pathname),eZ(e,"locale",d.detectedLocale),eZ(e,"defaultLocale",l),d.detectedLocale||eL(e,"localeInferredFromDefault"),!d.detectedLocale&&!n)return eZ(e,"locale",l),await this.render404(e,t,r),!0}return r.pathname=a,eZ(e,"isNextDataReq",!0),!1},this.handleNextImageRequest=()=>!1,this.handleCatchallRenderRequest=()=>!1,this.handleCatchallMiddlewareRequest=()=>!1,this.normalize=e=>{let t=[];for(let r of(this.normalizers.data&&t.push(this.normalizers.data),this.normalizers.segmentPrefetchRSC&&t.push(this.normalizers.segmentPrefetchRSC),this.normalizers.prefetchRSC&&t.push(this.normalizers.prefetchRSC),this.normalizers.rsc&&t.push(this.normalizers.rsc),t))if(r.match(e))return r.normalize(e,!0);return e},this.normalizeAndAttachMetadata=async(e,t,r)=>{let n=await this.handleNextImageRequest(e,t,r);return!!(n||this.enabledDirectories.pages&&(n=await this.handleNextDataRequest(e,t,r)))||!1},this.prepared=!1,this.preparedPromise=null,this.customErrorNo404Warn=function(e){let t,r=!1;return function(){for(var n=arguments.length,i=Array(n),s=0;s<n;s++)i[s]=arguments[s];return r||(r=!0,t=e(...i)),t}}(()=>{tx(`You have added a custom /_error page without a custom /404 page. This prevents the 404 page from being auto statically optimized.
|
13
|
-
See here for info: https://nextjs.org/docs/messages/custom-error-no-custom-404`)});let{dir:i=".",quiet:s=!1,conf:a,dev:o=!1,minimalMode:l=!1,hostname:d,port:u,experimentalTestProxy:c}=e;this.experimentalTestProxy=c,this.serverOptions=e,this.dir=v.resolve(i),this.quiet=s,this.loadEnvConfig({dev:o}),this.nextConfig=a,this.hostname=d,this.hostname&&(this.fetchHostname=function(e){return tk.test(e)?`[${e}]`:e}(this.hostname)),this.port=u,this.distDir=v.join(this.dir,this.nextConfig.distDir),this.publicDir=this.getPublicDir(),this.hasStaticDir=!l&&this.getHasStaticDir(),this.i18nProvider=(null==(t=this.nextConfig.i18n)?void 0:t.locales)?new nP(this.nextConfig.i18n):void 0,this.localeNormalizer=this.i18nProvider?new rQ(this.i18nProvider):void 0;let{serverRuntimeConfig:h={},publicRuntimeConfig:p,assetPrefix:f,generateEtags:m}=this.nextConfig;this.buildId=this.getBuildId(),this.minimalMode=l||!!process.env.NEXT_PRIVATE_MINIMAL_MODE,this.enabledDirectories=this.getEnabledDirectories(o),this.isAppPPREnabled=this.enabledDirectories.app&&function(e){return void 0!==e&&("boolean"==typeof e?e:"incremental"===e)}(this.nextConfig.experimental.ppr),this.isAppSegmentPrefetchEnabled=this.enabledDirectories.app&&!0===this.nextConfig.experimental.clientSegmentCache,this.normalizers={rsc:this.enabledDirectories.app&&1?new nI:void 0,prefetchRSC:this.isAppPPREnabled&&1?new nk:void 0,segmentPrefetchRSC:this.isAppSegmentPrefetchEnabled&&1?new nG:void 0,data:this.enabledDirectories.pages?new nj(this.buildId):void 0},this.nextFontManifest=this.getNextFontManifest(),process.env.NEXT_DEPLOYMENT_ID=this.nextConfig.deploymentId||"",this.renderOpts={dir:this.dir,supportsDynamicResponse:!0,trailingSlash:this.nextConfig.trailingSlash,deploymentId:this.nextConfig.deploymentId,poweredByHeader:this.nextConfig.poweredByHeader,canonicalBase:this.nextConfig.amp.canonicalBase||"",generateEtags:m,previewProps:this.getPrerenderManifest().preview,ampOptimizerConfig:null==(r=this.nextConfig.experimental.amp)?void 0:r.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(p).length>0?p:void 0,isExperimentalCompile:this.nextConfig.experimental.isExperimentalCompile,htmlLimitedBots:this.nextConfig.htmlLimitedBots,experimental:{expireTime:this.nextConfig.expireTime,staleTimes:this.nextConfig.experimental.staleTimes,clientTraceMetadata:this.nextConfig.experimental.clientTraceMetadata,cacheComponents:this.nextConfig.experimental.cacheComponents??!1,clientSegmentCache:"client-only"===this.nextConfig.experimental.clientSegmentCache?"client-only":!!this.nextConfig.experimental.clientSegmentCache,clientParamParsing:this.nextConfig.experimental.clientParamParsing??!1,clientParamParsingOrigins:this.nextConfig.experimental.clientParamParsingOrigins,dynamicOnHover:this.nextConfig.experimental.dynamicOnHover??!1,inlineCss:this.nextConfig.experimental.inlineCss??!1,authInterrupts:!!this.nextConfig.experimental.authInterrupts},onInstrumentationRequestError:this.instrumentationOnRequestError.bind(this),reactMaxHeadersLength:this.nextConfig.reactMaxHeadersLength},(0,tq.setConfig)({serverRuntimeConfig:h,publicRuntimeConfig:p}),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(f),this.responseCache=this.getResponseCache({dev:o})}reloadMatchers(){return this.matchers.reload()}getRouteMatchers(){let e=new nR(e=>{switch(e){case eF:return this.getPagesManifest()??null;case eH:return this.getAppPathsManifest()??null;default:return null}}),t=new r2;return t.push(new nC(this.distDir,e,this.i18nProvider)),t.push(new nx(this.distDir,e,this.i18nProvider)),this.enabledDirectories.app&&(t.push(new nh(this.distDir,e)),t.push(new nf(this.distDir,e))),t}async instrumentationOnRequestError(...e){let[t,r,n]=e;if(this.instrumentation)try{await (null==this.instrumentation.onRequestError?void 0:this.instrumentation.onRequestError.call(this.instrumentation,t,{path:r.url||"",method:r.method||"GET",headers:r instanceof nX?Object.fromEntries(r.headers.entries()):r.headers},n))}catch(e){console.error("Error in instrumentation.onRequestError:",e)}}logError(e){this.quiet||tb(e)}async handleRequest(e,t,r){await this.prepare();let n=e.method.toUpperCase(),i=(0,tt.getTracer)();return i.withPropagatedContext(e.headers,()=>i.trace(rh.handleRequest,{spanName:`${n}`,kind:tt.SpanKind.SERVER,attributes:{"http.method":n,"http.target":e.url}},async s=>this.handleRequestImpl(e,t,r).finally(()=>{if(!s)return;let r=eM(e,"isRSCRequest")??!1;s.setAttributes({"http.status_code":t.statusCode,"next.rsc":r}),t.statusCode&&t.statusCode>=500&&(s.setStatus({code:tt.SpanStatusCode.ERROR}),s.setAttribute("error.type",t.statusCode.toString()));let a=i.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==rh.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let o=a.get("next.route");if(o){let e=r?`RSC ${n} ${o}`:`${n} ${o}`;s.setAttributes({"next.route":o,"http.route":o,"next.span_name":e}),s.updateName(e)}else s.updateName(r?`RSC ${n}`:`${n}`)})))}async handleRequestImpl(e,t,r){try{await this.matchers.waitTillReady();var n,i,s,a,o,l,d,u,c,h=t.originalResponse;let p=h.setHeader.bind(h);h.setHeader=(t,r)=>{if("headersSent"in h&&h.headersSent)return h;if("set-cookie"===t.toLowerCase()){let t=eM(e,"middlewareCookie");t&&Array.isArray(r)&&r.every((e,r)=>e===t[r])||(r=[...new Set([...t||[],..."string"==typeof r?[r]:Array.isArray(r)?r:[]])])}return p(t,r)};let f=(e.url||"").split("?",1)[0];if(null==f?void 0:f.match(/(\\|\/\/)/)){let r=function(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?"?"+t.slice(1).join("?"):"")}(e.url);t.redirect(r,308).body(r).send();return}if(!r||"object"!=typeof r){if(!e.url)throw Object.defineProperty(Error("Invariant: url can not be undefined"),"__NEXT_ERROR_CODE",{value:"E123",enumerable:!1,configurable:!0});r=(0,b.parse)(e.url,!0)}if(!r.pathname)throw Object.defineProperty(Error("Invariant: pathname can't be empty"),"__NEXT_ERROR_CODE",{value:"E412",enumerable:!1,configurable:!0});"string"==typeof r.query&&(r.query=Object.fromEntries(new URLSearchParams(r.query)));let{originalRequest:m=null}=e,g=null==m?void 0:m.headers["x-forwarded-proto"],y=g?"https"===g:!!(null==m||null==(n=m.socket)?void 0:n.encrypted);e.headers["x-forwarded-host"]??=e.headers.host??this.hostname,e.headers["x-forwarded-port"]??=this.port?this.port.toString():y?"443":"80",e.headers["x-forwarded-proto"]??=y?"https":"http",e.headers["x-forwarded-for"]??=null==m||null==(i=m.socket)?void 0:i.remoteAddress,this.attachRequestMeta(e,r);let v=await this.handleRSCRequest(e,t,r);if(v)return;let _=null==(s=this.i18nProvider)?void 0:s.detectDomainLocale(t9(r,e.headers)),x=(null==_?void 0:_.defaultLocale)||(null==(a=this.nextConfig.i18n)?void 0:a.defaultLocale);eZ(e,"defaultLocale",x);let E=tf(e.url.replace(/^\/+/,"/")),w=t6(E.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});E.pathname=w.pathname,w.basePath&&(e.url=t5(e.url,this.nextConfig.basePath));let C="string"==typeof e.headers[e1];if(C)try{this.enabledDirectories.app&&(e.url.match(/^\/index($|\?)/)&&(e.url=e.url.replace(/^\/index/,"/")),r.pathname="/index"===r.pathname?"/":r.pathname);let{pathname:n}=new URL(function(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return new TextDecoder("utf-8").decode(t)}(e.headers[e1]),"http://localhost"),{pathname:i}=new URL(e.url,"http://localhost");if(null==(o=this.normalizers.data)?void 0:o.match(i))eZ(e,"isNextDataReq",!0);else if(this.isAppPPREnabled&&"1"===e.headers["next-resume"]&&"POST"===e.method){let t=[];for await(let r of e.body)t.push(r);let r=Buffer.concat(t).toString("utf8");eZ(e,"postponed",r)}n=this.normalize(n);let s=this.stripNextDataPath(i);n=rE(n);let a=null==(l=this.i18nProvider)?void 0:l.analyze(n,{defaultLocale:x});a&&(eZ(e,"locale",a.detectedLocale),a.inferredFromDefault?eZ(e,"localeInferredFromDefault",!0):eL(e,"localeInferredFromDefault"));let c=n,h=tL(c),p={params:!1,hasValidParams:!1};if(!h){let e=await this.matchers.match(c,{i18n:a});e&&(c=e.definition.pathname,void 0!==e.params&&(h=!0,p.params=e.params,p.hasValidParams=!0))}a&&(n=a.pathname);let f=function({page:e,i18n:t,basePath:r,rewrites:n,pageIsDynamic:i,trailingSlash:s,caseSensitive:a}){let o,l,d;return i&&(d=(l=eD(o=function(e,t){var r,n,i;let s=function(e,t,r,n,i){let s,a=(s=0,()=>{let e="",t=++s;for(;t>0;)e+=String.fromCharCode(97+(t-1)%26),t=Math.floor((t-1)/26);return e}),o={},l=[];for(let s of tQ(e).slice(1).split("/")){let e=tD.some(e=>s.startsWith(e)),d=s.match(rT);if(e&&d&&d[2])l.push(rI({getSafeRouteKey:a,interceptionMarker:d[1],segment:d[2],routeKeys:o,keyPrefix:t?e0:void 0,backreferenceDuplicateKeys:i}));else if(d&&d[2]){n&&d[1]&&l.push("/"+rP(d[1]));let e=rI({getSafeRouteKey:a,segment:d[2],routeKeys:o,keyPrefix:t?eQ:void 0,backreferenceDuplicateKeys:i});n&&d[1]&&(e=e.substring(1)),l.push(e)}else l.push("/"+rP(s));r&&d&&d[3]&&l.push(rP(d[3]))}return{namedParameterizedRoute:l.join(""),routeKeys:o}}(e,t.prefixRouteKeys,null!=(r=t.includeSuffix)&&r,null!=(n=t.includePrefix)&&n,null!=(i=t.backreferenceDuplicateKeys)&&i),a=s.namedParameterizedRoute;return t.excludeOptionalTrailingSlash||(a+="(?:/)?"),{...rS(e,t),namedRegex:"^"+a+"$",routeKeys:s.routeKeys}}(e,{prefixRouteKeys:!1})))(e)),{handleRewrites:function(o,d){let u={},c=d.pathname,h=n=>{let h=rw(n.source+(s?"(/)?":""),{removeUnnamedParams:!0,strict:!0,sensitive:!!a});if(!d.pathname)return!1;let p=h(d.pathname);if((n.has||n.missing)&&p){let e=rA(o,d.query,n.has,n.missing);e?Object.assign(p,e):p=!1}if(p){try{if(rB(n)){let e=o.headers[rz];e&&(p={...function e(t,r){for(let n of(void 0===r&&(r={}),Object.values(t[1]))){let t=n[0],i=Array.isArray(t),s=i?t[1]:t;!s||s.startsWith("__PAGE__")||(i&&("c"===t[2]||"oc"===t[2])?r[t[0]]=t[1].split("/"):i&&(r[t[0]]=t[1]),r=e(n,r))}return r}(function(e){if(void 0!==e){if(Array.isArray(e))throw Object.defineProperty(Error("Multiple router state headers were sent. This is not allowed."),"__NEXT_ERROR_CODE",{value:"E418",enumerable:!1,configurable:!0});if(e.length>4e4)throw Object.defineProperty(Error("The router state header was too large."),"__NEXT_ERROR_CODE",{value:"E142",enumerable:!1,configurable:!0});try{let t=JSON.parse(decodeURIComponent(e));return(0,r$.assert)(t,rq),t}catch{throw Object.defineProperty(Error("The router state header was sent but could not be parsed."),"__NEXT_ERROR_CODE",{value:"E10",enumerable:!1,configurable:!0})}}}(e)),...p})}}catch(e){}let{parsedDestination:s,destQuery:a}=function(e){let t,r,n=function(e){let t=e.destination;for(let n of Object.keys({...e.params,...e.query}))if(n){var r;r=t,t=r.replace(RegExp(":"+rP(n),"g"),"__ESC_COLON_"+n)}let n=tf(t),i=n.pathname;i&&(i=rk(i));let s=n.href;s&&(s=rk(s));let a=n.hostname;a&&(a=rk(a));let o=n.hash;o&&(o=rk(o));let l=n.search;l&&(l=rk(l));let d=n.origin;return d&&(d=rk(d)),{...n,pathname:i,hostname:a,href:s,hash:o,search:l,origin:d}}(e),{hostname:i,query:s,search:a}=n,o=n.pathname;n.hash&&(o=""+o+n.hash);let l=[],d=[];for(let e of(ej(o,d),d))l.push(e.name);if(i){let e=[];for(let t of(ej(i,e),e))l.push(t.name)}let u=eN(o,{validate:!1});for(let[r,n]of(i&&(t=eN(i,{validate:!1})),Object.entries(s)))Array.isArray(n)?s[r]=n.map(t=>rj(rk(t),e.params)):"string"==typeof n&&(s[r]=rj(rk(n),e.params));let c=Object.keys(e.params).filter(e=>"nextInternalLocale"!==e);if(e.appendParamsToQuery&&!c.some(e=>l.includes(e)))for(let t of c)t in s||(s[t]=e.params[t]);if(t$(o))for(let t of o.split("/")){let r=tD.find(e=>t.startsWith(e));if(r){"(..)(..)"===r?(e.params["0"]="(..)",e.params["1"]="(..)"):e.params["0"]=r;break}}try{let[i,s]=(r=u(e.params)).split("#",2);t&&(n.hostname=t(e.params)),n.pathname=i,n.hash=(s?"#":"")+(s||""),n.search=a?rj(a,e.params):""}catch(e){if(e.message.match(/Expected .*? to not repeat, but got an array/))throw Object.defineProperty(Error("To use a multi-match in the destination you must add `*` at the end of the param name to signify it should repeat. https://nextjs.org/docs/messages/invalid-multi-match"),"__NEXT_ERROR_CODE",{value:"E329",enumerable:!1,configurable:!0});throw e}return n.query={...e.query,...n.query},{newUrl:r,destQuery:s,parsedDestination:n}}({appendParamsToQuery:!0,destination:n.destination,params:p,query:d.query});if(s.protocol)return!0;if(Object.assign(u,a,p),Object.assign(d.query,s.query),delete s.query,Object.entries(d.query).forEach(([e,t])=>{if(t&&"string"==typeof t&&t.startsWith(":")){let r=u[t.slice(1)];r&&(d.query[e]=r)}}),Object.assign(d,s),!(c=d.pathname))return!1;if(r&&(c=c.replace(RegExp(`^${r}`),"")||"/"),t){let e=t8(c,t.locales);c=e.pathname,d.query.nextInternalLocale=e.detectedLocale||p.nextInternalLocale}if(c===e)return!0;if(i&&l){let e=l(c);if(e)return d.query={...d.query,...e},!0}}return!1};for(let e of n.beforeFiles||[])h(e);if(c!==e){let t=!1;for(let e of n.afterFiles||[])if(t=h(e))break;if(!t&&!(()=>{let t=tQ(c||"");return t===tQ(e)||(null==l?void 0:l(t))})()){for(let e of n.fallback||[])if(t=h(e))break}}return u},defaultRouteRegex:o,dynamicRouteMatcher:l,defaultRouteMatches:d,normalizeQueryParams:function(e,t){for(let[r,n]of(delete e.nextInternalLocale,Object.entries(e))){let i=tJ(r);i&&(delete e[r],t.add(i),void 0!==n&&(e[i]=Array.isArray(n)?n.map(e=>rN(e)):rN(n)))}},getParamsFromRouteMatches:function(e){if(!o)return null;let{groups:t,routeKeys:r}=o,n=eD({re:{exec:e=>{let n=Object.fromEntries(new URLSearchParams(e));for(let[e,t]of Object.entries(n)){let r=tJ(e);r&&(n[r]=t,delete n[e])}let i={};for(let e of Object.keys(r)){let s=r[e];if(!s)continue;let a=t[s],o=n[e];if(!a.optional&&!o)return null;i[a.pos]=o}return i}},groups:t})(e);return n||null},normalizeDynamicRouteParams:(e,t)=>{if(!o||!d)return{params:{},hasValidParams:!1};var r=o,n=d;let i={};for(let s of Object.keys(r.groups)){let a=e[s];"string"==typeof a?a=tN(a):Array.isArray(a)&&(a=a.map(tN));let o=n[s],l=r.groups[s].optional;if((Array.isArray(o)?o.some(e=>Array.isArray(a)?a.some(t=>t.includes(e)):null==a?void 0:a.includes(e)):null==a?void 0:a.includes(o))||void 0===a&&!(l&&t))return{params:{},hasValidParams:!1};l&&(!a||Array.isArray(a)&&1===a.length&&("index"===a[0]||a[0]===`[[...${s}]]`))&&(a=void 0,delete e[s]),a&&"string"==typeof a&&r.groups[s].repeat&&(a=a.split("/")),a&&(i[s]=a)}return{params:i,hasValidParams:!0}},normalizeCdnUrl:(e,t)=>(function(e,t){let r=function(e){let t=function(e){let t;try{t=new URL(e,"http://n")}catch{}return t}(e);if(!t)return;let r={};for(let e of t.searchParams.keys()){let n=t.searchParams.getAll(e);r[e]=n.length>1?n:n[0]}return{query:r,hash:t.hash,search:t.search,path:t.pathname,pathname:t.pathname,href:`${t.pathname}${t.search}${t.hash}`,host:"",hostname:"",auth:"",protocol:"",slashes:null,port:""}}(e.url);if(!r)return e.url;delete r.search,rG(r.query,t),e.url=function(e){let{auth:t,hostname:r}=e,n=e.protocol||"",i=e.pathname||"",s=e.hash||"",a=e.query||"",o=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?o=t+e.host:r&&(o=t+(~r.indexOf(":")?"["+r+"]":r),e.port&&(o+=":"+e.port)),a&&"object"==typeof a&&(a=String(function(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,tp(e));else t.set(r,tp(n));return t}(a)));let l=e.search||a&&"?"+a||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||rD.test(n))&&!1!==o?(o="//"+(o||""),i&&"/"!==i[0]&&(i="/"+i)):o||(o=""),s&&"#"!==s[0]&&(s="#"+s),l&&"?"!==l[0]&&(l="?"+l),i=i.replace(/[?#]/g,encodeURIComponent),""+n+o+i+(l=l.replace("#","%23"))+s}(r)})(e,t),interpolateDynamicPath:(e,t)=>(function(e,t,r){if(!r)return e;for(let n of Object.keys(r.groups)){let i,{optional:s,repeat:a}=r.groups[n],o=`[${a?"...":""}${n}]`;s&&(o=`[${o}]`);let l=t[n];((i=Array.isArray(l)?l.map(e=>e&&encodeURIComponent(e)).join("/"):l?encodeURIComponent(l):"")||s)&&(e=e.replaceAll(o,i))}return e})(e,t,o),filterInternalQuery:(e,t)=>rG(e,t)}}({pageIsDynamic:h,page:c,i18n:this.nextConfig.i18n,basePath:this.nextConfig.basePath,rewrites:(null==(d=this.getRoutesManifest())?void 0:d.rewrites)||{beforeFiles:[],afterFiles:[],fallback:[]},caseSensitive:!!this.nextConfig.experimental.caseSensitiveRoutes});x&&!w.locale&&(r.pathname=`/${x}${r.pathname}`);let m={...r.query},g=r.pathname,y=Object.keys(f.handleRewrites(e,r)),_={...r.query},b=g!==r.pathname;b&&r.pathname&&eZ(e,"rewroteURL",r.pathname);let C=new Set;for(let[e,t]of Object.entries(r.query)){let n=tJ(e);n&&(delete r.query[e],C.add(n),void 0!==t&&(_[n]=Array.isArray(t)?t.map(e=>rN(e)):rN(t)))}if(h){let t={};if(p.hasValidParams||(p=f.normalizeDynamicRouteParams(_,!1)),!p.hasValidParams&&!tL(s)){let e=null==f.dynamicRouteMatcher?void 0:f.dynamicRouteMatcher.call(f,s);e&&(f.normalizeDynamicRouteParams(e,!1),Object.assign(p.params,e),p.hasValidParams=!0)}if("/index"!==n&&!p.hasValidParams&&!tL(n)){let e=null==f.dynamicRouteMatcher?void 0:f.dynamicRouteMatcher.call(f,n);if(e){let r=f.normalizeDynamicRouteParams(e,!1);r.hasValidParams&&(Object.assign(t,e),p=r)}}p.hasValidParams&&(t=p.params);let r=e.headers["x-now-route-matches"];if("string"==typeof r&&r&&tL(n)&&!p.hasValidParams){let e=f.getParamsFromRouteMatches(r);e&&(p=f.normalizeDynamicRouteParams(e,!0)).hasValidParams&&(t=p.params)}if(!p.hasValidParams&&(p=f.normalizeDynamicRouteParams(_,!0)).hasValidParams&&(t=p.params),f.defaultRouteMatches&&s===c&&!p.hasValidParams&&(t=f.defaultRouteMatches,""===r&&eZ(e,"renderFallbackShell",!0)),t){n=f.interpolateDynamicPath(c,t),e.url=f.interpolateDynamicPath(e.url,t);let r=eM(e,"segmentPrefetchRSCRequest");r&&tL(r,!1)&&(r=f.interpolateDynamicPath(r,t),e.headers[rH]=r,eZ(e,"segmentPrefetchRSCRequest",r))}}for(let t of((h||b)&&f.normalizeCdnUrl(e,[...y,...Object.keys((null==(u=f.defaultRouteRegex)?void 0:u.groups)||{})]),C))t in m||delete r.query[t];if(r.pathname=n,E.pathname=r.pathname,v=await this.normalizeAndAttachMetadata(e,t,r))return}catch(r){if(r instanceof ew||r instanceof eC)return t.statusCode=400,this.renderError(null,e,t,"/_error",{});throw r}if(eZ(e,"isLocaleDomain",!!_),w.locale&&(e.url=(0,b.format)(E),eZ(e,"didStripLocale",!0)),!eM(e,"locale")&&(w.locale?eZ(e,"locale",w.locale):x&&(eZ(e,"locale",x),eZ(e,"localeInferredFromDefault",!0))),!this.serverOptions.webServerConfig&&!eM(e,"incrementalCache")){let t=await this.getIncrementalCache({requestHeaders:Object.assign({},e.headers)});t.resetRequestCache(),eZ(e,"incrementalCache",t),globalThis.__incrementalCache=t}let R=function(){if(nW[nV])return nW[nV].values()}();R&&await Promise.all([...R].map(async t=>{if("refreshTags"in t);else{let r=rK(e.headers,this.getPrerenderManifest().preview.previewModeId);await t.receiveExpiredTags(...r)}})),eM(e,"serverComponentsHmrCache")||eZ(e,"serverComponentsHmrCache",this.getServerComponentsHmrCache());let P=eM(e,"invokePath");if(!C&&P){let n=eM(e,"invokeStatus");if(n){let i=eM(e,"invokeQuery");i&&Object.assign(r.query,i),t.statusCode=n;let s=eM(e,"invokeError")||null;return this.renderError(s,e,t,"/_error",r.query)}let i=new URL(P||"/","http://n"),s=t6(i.pathname,{nextConfig:this.nextConfig,parseData:!1});s.locale&&eZ(e,"locale",s.locale),r.pathname!==i.pathname&&(r.pathname=i.pathname,eZ(e,"rewroteURL",s.pathname));let a=t8(t5(r.pathname,this.nextConfig.basePath||""),null==(c=this.nextConfig.i18n)?void 0:c.locales);for(let t of(a.detectedLocale&&eZ(e,"locale",a.detectedLocale),r.pathname=a.pathname,Object.keys(r.query)))delete r.query[t];let o=eM(e,"invokeQuery");if(o&&Object.assign(r.query,o),v=await this.normalizeAndAttachMetadata(e,t,r))return;await this.handleCatchallRenderRequest(e,t,r);return}if(eM(e,"middlewareInvoke")){if((v=await this.normalizeAndAttachMetadata(e,t,r))||(v=await this.handleCatchallMiddlewareRequest(e,t,r)))return;let n=Error();throw n.result={response:new Response(null,{headers:{"x-middleware-next":"1"}})},n.bubble=!0,n}return!C&&w.basePath&&(r.pathname=t5(r.pathname,w.basePath)),t.statusCode=200,await this.run(e,t,r)}catch(r){if(r instanceof nK.NoFallbackError)throw r;if(r&&"object"==typeof r&&"ERR_INVALID_URL"===r.code||r instanceof ew||r instanceof eC)return t.statusCode=400,this.renderError(null,e,t,"/_error",{});throw r}}getRequestHandlerWithMetadata(e){let t=this.getRequestHandler();return(r,n,i)=>(r[e$]=e,t(r,n,i))}getRequestHandler(){return this.handleRequest.bind(this)}setAssetPrefix(e){this.nextConfig.assetPrefix=e?e.replace(/\/$/,""):""}async prepare(){if(!this.prepared)return this.instrumentation||(this.instrumentation=await this.loadInstrumentationModule()),null===this.preparedPromise&&(this.preparedPromise=this.prepareImpl().then(()=>{this.prepared=!0,this.preparedPromise=null})),this.preparedPromise}async prepareImpl(){}async loadInstrumentationModule(){}async close(){}getAppPathRoutes(){let e={};return Object.keys(this.appPathsManifest||{}).forEach(t=>{let r=tj(t);e[r]||(e[r]=[]),e[r].push(t)}),e}async run(e,t,r){return(0,tt.getTracer)().trace(rh.run,async()=>this.runImpl(e,t,r))}async runImpl(e,t,r){await this.handleCatchallRenderRequest(e,t,r)}async pipe(e,t){return(0,tt.getTracer)().trace(rh.pipe,async()=>this.pipeImpl(e,t))}async pipeImpl(e,t){let r=t.req.headers["user-agent"]||"",n={...t,renderOpts:{...this.renderOpts,supportsDynamicResponse:!this.renderOpts.botType,serveStreamingMetadata:function(e,t){let r=RegExp(t||tF,"i");return!(e&&r.test(e))}(r,this.nextConfig.htmlLimitedBots)}},i=await e(n);if(null===i)return;let{req:s,res:a}=n,o=a.statusCode,{body:l}=i,{cacheControl:d}=i;if(!a.sent){let{generateEtags:e,poweredByHeader:t,dev:r}=this.renderOpts;r&&(a.setHeader("Cache-Control","no-store, must-revalidate"),d=void 0),d&&void 0===d.expire&&(d.expire=this.nextConfig.expireTime),await this.sendRenderResult(s,a,{result:l,generateEtags:e,poweredByHeader:t,cacheControl:d}),a.statusCode=o}}async getStaticHTML(e,t){let r={...t,renderOpts:{...this.renderOpts,supportsDynamicResponse:!1}},n=await e(r);return null===n?null:n.body.toUnchunkedString()}async render(e,t,r,n={},i,s=!1){return(0,tt.getTracer)().trace(rh.render,async()=>this.renderImpl(e,t,r,n,i,s))}getWaitUntil(){let e=function(){let e=globalThis[nD];return null==e?void 0:e.get()}();if(e)return e.waitUntil}getInternalWaitUntil(){}async renderImpl(e,t,r,n={},i,s=!1){var a;r.startsWith("/")||console.warn(`Cannot render page with path "${r}", did you mean "/${r}"?. See more info here: https://nextjs.org/docs/messages/render-no-starting-slash`),this.serverOptions.customServer&&"/index"===r&&!await this.hasPage("/index")&&(r="/");let o=e.headers["user-agent"]||"";return this.renderOpts.botType=function(e){return tz.test(e)?"dom":tU.test(e)?"html":void 0}(o),(a=r,eW.includes(a))?this.render404(e,t,i):this.pipe(e=>this.renderToResponse(e),{req:e,res:t,pathname:r,query:n})}async getStaticPaths({pathname:e}){var t;return{staticPaths:void 0,fallbackMode:function(e){if("string"==typeof e)return"PRERENDER";if(null===e)return"BLOCKING_STATIC_RENDER";if(!1===e)return"NOT_FOUND";if(void 0!==e)throw Object.defineProperty(Error(`Invalid fallback option: ${e}. Fallback option must be a string, null, undefined, or false.`),"__NEXT_ERROR_CODE",{value:"E285",enumerable:!1,configurable:!0})}(null==(t=this.getPrerenderManifest().dynamicRoutes[e])?void 0:t.fallback)}}async renderToResponseWithComponents(e,t){return(0,tt.getTracer)().trace(rh.renderToResponseWithComponents,async()=>this.renderToResponseWithComponentsImpl(e,t))}pathCouldBeIntercepted(e){return t$(e)||this.interceptionRoutePatterns.some(t=>t.test(e))}setVaryHeader(e,t,r,n){let i=`rsc, ${rz}, ${rF}, ${rH}`,s=eM(e,"isRSCRequest")??!1,a=!1;r&&this.pathCouldBeIntercepted(n)?(t.appendHeader("vary",`${i}, ${rV}`),a=!0):(r||s)&&t.appendHeader("vary",i),a||delete e.headers[rV]}async renderToResponseWithComponentsImpl({req:e,res:t,pathname:r,renderOpts:n},{components:i,query:s}){var a,o,l,d,u,c;let h,p;r===eq&&(r="/404");let f="/_error"===r,m="/404"===r||f&&404===t.statusCode,g="/500"===r||f&&500===t.statusCode,y=!0===i.isAppPath,v=!!i.getServerSideProps,_=function(e){let t,r;e.headers instanceof Headers?(t=e.headers.get(rU)??null,r=e.headers.get("content-type")):(t=e.headers[rU]??null,r=e.headers["content-type"]??null);let n="POST"===e.method&&"application/x-www-form-urlencoded"===r,i=!!("POST"===e.method&&(null==r?void 0:r.startsWith("multipart/form-data"))),s=void 0!==t&&"string"==typeof t&&"POST"===e.method;return{actionId:t,isURLEncodedAction:n,isMultipartAction:i,isFetchAction:s,isPossibleServerAction:!!(s||n||i)}}(e).isPossibleServerAction,x=!!i.getStaticProps,E=eM(e,"isRSCRequest")??!1,w=(0,b.parse)(e.url||"").pathname||"/",C=eM(e,"rewroteURL")||w;this.setVaryHeader(e,t,y,C);let R=this.getPrerenderManifest();(null==h?void 0:h.includes(C))||e.headers["x-now-route-matches"]?x=!0:x||=!!R.routes[nN(r)];let P=!!(eM(e,"isNextDataReq")||e.headers["x-nextjs-data"]&&this.serverOptions.webServerConfig)&&(x||v);if(!x&&e.headers["x-middleware-prefetch"]&&!(m||"/_error"===r))return t.setHeader(e1,r),t.setHeader("x-middleware-skip","1"),t.setHeader("cache-control","private, no-cache, no-store, max-age=0, must-revalidate"),t.body("{}").send(),null;x&&e.headers[e1]&&e.url.startsWith("/_next/data")&&(e.url=this.stripNextDataPath(e.url));let T=eM(e,"locale");e.headers["x-nextjs-data"]&&(!t.statusCode||200===t.statusCode)&&t.setHeader("x-nextjs-matched-path",`${T?`/${T}`:""}${r}`),i.routeModule&&(p=i.routeModule);let O=this.isAppPPREnabled&&void 0!==p&&p.definition.kind===nl.APP_PAGE,S="1"===process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING&&void 0!==s.__nextppronly&&O,I=O&&((null==(a=R.routes[r]??R.dynamicRoutes[r])?void 0:a.renderingMode)==="PARTIALLY_STATIC"||S&&!0===this.experimentalTestProxy)?eM(e,"postponed"):void 0;if(!m||P||E||(t.statusCode=404),eX.includes(r)&&(t.statusCode=parseInt(r.slice(1),10)),!_&&!I&&!m&&!g&&"/_error"!==r&&"HEAD"!==e.method&&"GET"!==e.method&&("string"==typeof i.Component||x))return t.statusCode=405,t.setHeader("Allow",["GET","HEAD"]),t.body("Method Not Allowed").send(),null;if("string"==typeof i.Component)return{body:rb.fromStatic(i.Component,eJ)};if("amp"in s&&!s.amp&&delete s.amp,!0===n.supportsDynamicResponse){let t=(u=d=e.headers["user-agent"]||"",tz.test(u)||tU.test(d)),r="function"!=typeof(null==(o=i.Document)?void 0:o.getInitialProps)||"__NEXT_BUILTIN_DOCUMENT__"in i.Document;n.supportsDynamicResponse=!x&&!t&&!s.amp&&r}if(!P&&y&&n.dev&&(n.supportsDynamicResponse=!0),x&&e.headers[e1]&&(C=w),w=tQ(w),C=tQ(C),this.localeNormalizer&&(C=this.localeNormalizer.normalize(C)),P&&(C=this.stripNextDataPath(C),w=this.stripNextDataPath(w)),(await this.getIncrementalCache({requestHeaders:Object.assign({},e.headers)})).resetRequestCache(),(null==p?void 0:p.isDev)&&tL(r)&&(i.getStaticPaths||y)){let t=await this.getStaticPaths({pathname:r,urlPathname:w,requestHeaders:e.headers,page:i.page,isAppPath:y});if(y&&this.nextConfig.experimental.cacheComponents&&(null==(l=t.prerenderedRoutes)?void 0:l.length)){let r=null;for(let e of t.prerenderedRoutes){let t=e.fallbackRouteParams;if(!t||0===t.length){r=null;break}(null===r||t.length<r.length)&&(r=t)}r&&eZ(e,"devValidatingFallbackParams",function(e){if(0===e.length)return null;let t=Math.random().toString(16).slice(2),r=new Map;for(let{paramName:n,paramType:i}of e)r.set(n,[`%%drp:${n}:${t}%%`,nJ[i]]);return r}(r))}}if("OPTIONS"===e.method&&!m&&(!p||p.definition.kind!==nl.APP_ROUTE))return await nT(e,t,new Response(null,{status:400})),null;let k=e.originalRequest,A=t.originalResponse,j=(0,b.parse)(eM(e,"initURL")||e.url),N=j.pathname||"/";for(let e of[this.normalizers.segmentPrefetchRSC,this.normalizers.prefetchRSC,this.normalizers.rsc])(null==e?void 0:e.match(N))&&(N=e.normalize(N));f||(k.url=`${N}${j.search||""}`),c=eM(e),k[e$]=c,eZ(k,"distDir",this.distDir),eZ(k,"query",s),eZ(k,"params",n.params),eZ(k,"ampValidator",this.renderOpts.ampValidator),eZ(k,"minimalMode",!0),n.err&&eZ(k,"invokeError",n.err);let D=i.ComponentMod.handler;return await D(k,A,{waitUntil:this.getWaitUntil()}),null}stripNextDataPath(e,t=!0){return(e.includes(this.buildId)&&(e=rE(e.substring(e.indexOf(this.buildId)+this.buildId.length).replace(/\.json$/,""))),this.localeNormalizer&&t)?this.localeNormalizer.normalize(e):e}getOriginalAppPaths(e){if(this.enabledDirectories.app){var t;let r=null==(t=this.appPathRoutes)?void 0:t[e];return r||null}return null}async renderPageComponent(e,t){var r;let{query:n,pathname:i}=e,s=this.getOriginalAppPaths(i),a=Array.isArray(s),o=i;a&&(o=s[s.length-1]);let l=await this.findPageComponents({locale:eM(e.req,"locale"),page:o,query:n,params:e.renderOpts.params||{},isAppPath:a,sriEnabled:!!(null==(r=this.nextConfig.experimental.sri)?void 0:r.algorithm),appPaths:s,shouldEnsure:!1});if(l){(0,tt.getTracer)().setRootSpanAttribute("next.route",i);try{return await this.renderToResponseWithComponents(e,l)}catch(r){let e=r instanceof nK.NoFallbackError;if(!e||e&&t)throw r}}return!1}async renderToResponse(e){return(0,tt.getTracer)().trace(rh.renderToResponse,{spanName:"rendering page",attributes:{"next.route":e.pathname}},async()=>this.renderToResponseImpl(e))}async renderToResponseImpl(e){var t;let{req:r,res:n,query:i,pathname:s}=e,a=eM(e.req,"bubbleNoFallback")??!1;delete i[rX];let o={i18n:null==(t=this.i18nProvider)?void 0:t.fromRequest(r,s)};try{for await(let t of this.matchers.matchAll(s,o)){eM(e.req,"invokeOutput");let r=await this.renderPageComponent({...e,pathname:t.definition.pathname,renderOpts:{...e.renderOpts,params:t.params}},a);if(!1!==r)return r}if(this.serverOptions.webServerConfig){e.pathname=this.serverOptions.webServerConfig.page;let t=await this.renderPageComponent(e,a);if(!1!==t)return t}}catch(i){let t=rJ(i);if(i instanceof eP)throw console.error("Invariant: failed to load static page",JSON.stringify({page:s,url:e.req.url,matchedPath:e.req.headers[e1],initUrl:eM(e.req,"initURL"),didRewrite:!!eM(e.req,"rewroteURL"),rewroteUrl:eM(e.req,"rewroteURL")},null,2)),t;if(t instanceof nK.NoFallbackError&&a)throw t;if(t instanceof ew||t instanceof eC)return n.statusCode=400,await this.renderErrorToResponse(e,t);n.statusCode=500,await this.hasPage("/500")&&(eZ(e.req,"customErrorRender",!0),await this.renderErrorToResponse(e,t),eL(e.req,"customErrorRender"));let r=t instanceof nQ;if(!r)throw rY(t)&&(t.page=s),t;return await this.renderErrorToResponse(e,r?t.innerError:t)}if(await this.getMiddleware()&&e.req.headers["x-nextjs-data"]&&(!n.statusCode||200===n.statusCode||404===n.statusCode)){let e=eM(r,"locale");return n.setHeader("x-nextjs-matched-path",`${e?`/${e}`:""}${s}`),n.statusCode=200,n.setHeader("Content-Type","application/json; charset=utf-8"),n.body("{}"),n.send(),null}return n.statusCode=404,this.renderErrorToResponse(e,null)}async renderToHTML(e,t,r,n={}){return(0,tt.getTracer)().trace(rh.renderToHTML,async()=>this.renderToHTMLImpl(e,t,r,n))}async renderToHTMLImpl(e,t,r,n={}){return this.getStaticHTML(e=>this.renderToResponse(e),{req:e,res:t,pathname:r,query:n})}async renderError(e,t,r,n,i={},s=!0){return(0,tt.getTracer)().trace(rh.renderError,async()=>this.renderErrorImpl(e,t,r,n,i,s))}async renderErrorImpl(e,t,r,n,i={},s=!0){return s&&r.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),this.pipe(async t=>{let n=await this.renderErrorToResponse(t,e);if(500===r.statusCode)throw e;return n},{req:t,res:r,pathname:n,query:i})}async renderErrorToResponse(e,t){return(0,tt.getTracer)().trace(rh.renderErrorToResponse,async()=>this.renderErrorToResponseImpl(e,t))}async renderErrorToResponseImpl(e,t){let{res:r,query:n}=e;try{let i=null,s=404===r.statusCode,a=this.enabledDirectories.app;s&&(a&&(i=await this.findPageComponents({locale:eM(e.req,"locale"),page:eU,query:n,params:{},isAppPath:!0,shouldEnsure:!0,url:e.req.url})),!i&&await this.hasPage("/404")&&(i=await this.findPageComponents({locale:eM(e.req,"locale"),page:"/404",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url})));let o=`/${r.statusCode}`;if(!eM(e.req,"customErrorRender")&&!i&&eX.includes(o)&&(!i&&a&&(i=await this.findPageComponents({locale:eM(e.req,"locale"),page:o,query:n,params:{},isAppPath:!0,shouldEnsure:!0,url:e.req.url})),i=await this.findPageComponents({locale:eM(e.req,"locale"),page:o,query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url})),i||(i=await this.findPageComponents({locale:eM(e.req,"locale"),page:"/_error",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url}),o="/_error"),!i)throw new nQ(Object.defineProperty(Error("missing required error components"),"__NEXT_ERROR_CODE",{value:"E60",enumerable:!1,configurable:!0}));i.components.routeModule?eZ(e.req,"match",{definition:i.components.routeModule.definition,params:void 0}):eL(e.req,"match");try{return await this.renderToResponseWithComponents({...e,pathname:o,renderOpts:{...e.renderOpts,err:t}},i)}catch(e){if(e instanceof nK.NoFallbackError)throw Object.defineProperty(Error("invariant: failed to render error page"),"__NEXT_ERROR_CODE",{value:"E55",enumerable:!1,configurable:!0});throw e}}catch(a){let t=rJ(a),i=t instanceof nQ;i||this.logError(t),r.statusCode=500;let s=await this.getFallbackErrorComponents(e.req.url);if(s)return eZ(e.req,"match",{definition:s.routeModule.definition,params:void 0}),this.renderToResponseWithComponents({...e,pathname:"/_error",renderOpts:{...e.renderOpts,err:i?t.innerError:t}},{query:n,components:s});return{body:rb.fromStatic("Internal Server Error","text/plain")}}}async renderErrorToHTML(e,t,r,n,i={}){return this.getStaticHTML(t=>this.renderErrorToResponse(t,e),{req:t,res:r,pathname:n,query:i})}async render404(e,t,r,n=!0){let{pathname:i,query:s}=r||(0,b.parse)(e.url,!0);return this.nextConfig.i18n&&(eM(e,"locale")||eZ(e,"locale",this.nextConfig.i18n.defaultLocale),eZ(e,"defaultLocale",this.nextConfig.i18n.defaultLocale)),t.statusCode=404,this.renderError(null,e,t,i,s,n)}}let n1=require("next/dist/server/load-manifest.external.js"),n4=new C(1e3);function n2(e,t,r,n){let i,s=`${e}:${t}:${r}:${n}`,a=null==n4?void 0:n4.get(s);if(a)return a;let o=_().join(t,eV);n&&(i=(0,n1.loadManifest)(_().join(o,eH),!0));let l=(0,n1.loadManifest)(_().join(o,eF),!0);try{e=rE(r6(e))}catch(t){throw console.error(t),new eR(e)}let d=t=>{let n=t[e];if(!t[n]&&r){let i={};for(let e of Object.keys(t))i[t8(e,r).pathname]=l[e];n=i[e]}return n};return(i&&(a=d(i)),a||(a=d(l)),a)?(_().isAbsolute(a)||(a=_().join(o,a)),null==n4||n4.set(s,a),a):(null==n4||n4.set(s,null),null)}function n9(e,t,r,n){let i=n2(e,t,r,n);if(!i)throw new eR(e);return i}async function n3(e,t,r){let n=n9(e,t,void 0,r);return n.endsWith(".html")?eT.promises.readFile(n,"utf8").catch(t=>{throw new eP(e,t.message)}):require(n)}function n8(e){return e.default||e}async function n5(e){return new Promise(t=>setTimeout(t,e))}let n6=Symbol.for("next.server.action-manifests");async function n7(e,t=3){for(;;)try{return(0,n1.loadManifest)(e)}catch(e){if(--t<=0)throw e;await n5(100)}}async function ie(e,t=3){try{return await n7(e,t)}catch(e){return}}async function it(e,t=3){for(;;)try{return(0,n1.evalManifest)(e)}catch(e){if(--t<=0)throw e;await n5(100)}}async function ir(e,t,r){try{return(await it(e,r)).__RSC_MANIFEST[t]}catch(e){return}}async function ii({distDir:e,page:t,isAppPath:r,isDev:n,sriEnabled:i,needsManifestsForLegacyReasons:s}){let a={},o={};if(r||([a,o]=await Promise.all([n3("/_document",e,!1),n3("/_app",e,!1)])),s){let s,l=n?3:1;s=(0,v.join)(e,"react-loadable-manifest.json");let d=!function(e){let t=e.replace(/\/route$/,"");return nr(e)&&function(e,t,r){let n=(r?"":"?")+"$",i=`\\d?${r?"":"(-\\w{6})?"}`,s=[RegExp(`^[\\\\/]robots${ni(t.concat("txt"),null)}${n}`),RegExp(`^[\\\\/]manifest${ni(t.concat("webmanifest","json"),null)}${n}`),RegExp("^[\\\\/]favicon\\.ico$"),RegExp(`[\\\\/]sitemap${ni(["xml"],t)}${n}`),RegExp(`[\\\\/]${nn.icon.filename}${i}${ni(nn.icon.extensions,t)}${n}`),RegExp(`[\\\\/]${nn.apple.filename}${i}${ni(nn.apple.extensions,t)}${n}`),RegExp(`[\\\\/]${nn.openGraph.filename}${i}${ni(nn.openGraph.extensions,t)}${n}`),RegExp(`[\\\\/]${nn.twitter.filename}${i}${ni(nn.twitter.extensions,t)}${n}`)],a=rx(e);return s.some(e=>e.test(a))}(t,[],!0)&&"/robots.txt"!==t&&"/manifest.webmanifest"!==t&&!t.endsWith("/sitemap.xml")}(t),[u,c,h,p,f,m]=await Promise.all([n7((0,v.join)(e,"build-manifest.json"),l),ie(s,l),r||0?void 0:n7((0,v.join)(e,"dynamic-css-manifest.json"),l).catch(()=>void 0),r&&d?ir((0,v.join)(e,"server","app",t.replace(/%5F/g,"_")+"_client-reference-manifest.js"),t.replace(/%5F/g,"_"),l):void 0,r?n7((0,v.join)(e,"server","server-reference-manifest.json"),l).catch(()=>null):null,i?n7((0,v.join)(e,"server","subresource-integrity-manifest.json")).catch(()=>void 0):void 0]);f&&p&&function({page:e,clientReferenceManifest:t,serverActionsManifest:r,serverModuleMap:n}){var i;let s=null==(i=globalThis[n6])?void 0:i.clientReferenceManifestsPerPage;globalThis[n6]={clientReferenceManifestsPerPage:{...s,[tj(e)]:t},serverActionsManifest:r,serverModuleMap:n}}({page:t,clientReferenceManifest:p,serverActionsManifest:f,serverModuleMap:function({serverActionsManifest:e}){return new Proxy({},{get:(t,r)=>{var n,i,s;let a,o=null==(i=e.node)||null==(n=i[r])?void 0:n.workers;if(!o)return;let l=eu.workAsyncStorage.getStore();if(!(a=l?o[t2(s=l.page,"app")?s:"app"+s]:Object.values(o).at(0)))return;let{moduleId:d,async:u}=a;return{id:d,name:r,chunks:[],async:u}}})}({serverActionsManifest:f})});let g=await n3(t,e,r),y=n8(g),_=n8(a),b=n8(o),{getServerSideProps:x,getStaticProps:E,getStaticPaths:w,routeModule:C}=g;return{App:b,Document:_,Component:y,buildManifest:u,subresourceIntegrityManifest:m,reactLoadableManifest:c||{},dynamicCssManifest:h,pageConfig:g.config||{},ComponentMod:g,getServerSideProps:x,getStaticProps:E,getStaticPaths:w,clientReferenceManifest:p,serverActionsManifest:f,isAppPath:r,page:t,routeModule:C}}{let n=await n3(t,e,r),i=n8(n),s=n8(a),l=n8(o),{getServerSideProps:d,getStaticProps:u,getStaticPaths:c,routeModule:h}=n;return{App:l,Document:s,Component:i,pageConfig:n.config||{},ComponentMod:n,getServerSideProps:d,getStaticProps:u,getStaticPaths:c,isAppPath:r,page:t,routeModule:h}}}let is=(0,tt.getTracer)().wrap(rp.loadComponents,ii);function ia(e){return(t,r,n)=>{for(let i of e)if(new RegExp(i.regexp).exec(t)){if((i.has||i.missing)&&!rA(r,n,i.has,i.missing))continue;return!0}return!1}}var io=r("../next-env/dist/index.js");let il=require("stream");var id=r.n(il);class iu{constructor(e,t=e=>e()){this.cacheKeyFn=e,this.schedulerFn=t,this.pending=new Map}static create(e){return new iu(null==e?void 0:e.cacheKeyFn,null==e?void 0:e.schedulerFn)}async batch(e,t){let r=this.cacheKeyFn?await this.cacheKeyFn(e):e;if(null===r)return t({resolve:e=>Promise.resolve(e),key:e});let n=this.pending.get(r);if(n)return n;let{promise:i,resolve:s,reject:a}=new rc;return this.pending.set(r,i),this.schedulerFn(async()=>{try{let r=await t({resolve:s,key:e});s(r)}catch(e){a(e)}finally{this.pending.delete(r)}}),i}}let ic=e=>{Promise.resolve().then(()=>{process.nextTick(e)})};var ih=function(e){return e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.PAGES="PAGES",e.FETCH="FETCH",e.REDIRECT="REDIRECT",e.IMAGE="IMAGE",e}({}),ip=function(e){return e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.PAGES="PAGES",e.FETCH="FETCH",e.IMAGE="IMAGE",e}({});async function im(e){var t,r;return{...e,value:(null==(t=e.value)?void 0:t.kind)===ih.PAGES?{kind:ih.PAGES,html:await e.value.html.toUnchunkedString(!0),pageData:e.value.pageData,headers:e.value.headers,status:e.value.status}:(null==(r=e.value)?void 0:r.kind)===ih.APP_PAGE?{kind:ih.APP_PAGE,html:await e.value.html.toUnchunkedString(!0),postponed:e.value.postponed,rscData:e.value.rscData,headers:e.value.headers,status:e.value.status,segmentData:e.value.segmentData}:e.value}}async function ig(e){var t,r;return e?{isMiss:e.isMiss,isStale:e.isStale,cacheControl:e.cacheControl,value:(null==(t=e.value)?void 0:t.kind)===ih.PAGES?{kind:ih.PAGES,html:rb.fromStatic(e.value.html,eJ),pageData:e.value.pageData,headers:e.value.headers,status:e.value.status}:(null==(r=e.value)?void 0:r.kind)===ih.APP_PAGE?{kind:ih.APP_PAGE,html:rb.fromStatic(e.value.html,eJ),rscData:e.value.rscData,headers:e.value.headers,status:e.value.status,postponed:e.value.postponed,segmentData:e.value.segmentData}:e.value}:null}class iy{constructor(e){this.getBatcher=iu.create({cacheKeyFn:({key:e,isOnDemandRevalidate:t})=>`${e}-${t?"1":"0"}`,schedulerFn:ic}),this.revalidateBatcher=iu.create({schedulerFn:ic}),this.minimal_mode=e}async get(e,t,r){var n;if(!e)return t({hasResolved:!1,previousCacheEntry:null});if(this.minimal_mode&&(null==(n=this.previousCacheItem)?void 0:n.key)===e&&this.previousCacheItem.expiresAt>Date.now())return ig(this.previousCacheItem.entry);let{incrementalCache:i,isOnDemandRevalidate:s=!1,isFallback:a=!1,isRoutePPREnabled:o=!1,isPrefetch:l=!1,waitUntil:d,routeKind:u}=r;return ig(await this.getBatcher.batch({key:e,isOnDemandRevalidate:s},({resolve:r})=>{let n=this.handleGet(e,t,{incrementalCache:i,isOnDemandRevalidate:s,isFallback:a,isRoutePPREnabled:o,isPrefetch:l,routeKind:u},r);return d&&d(n),n}))}async handleGet(e,t,r,n){let i=null,s=!1;try{if((i=this.minimal_mode?null:await r.incrementalCache.get(e,{kind:function(e){switch(e){case nl.PAGES:return ip.PAGES;case nl.APP_PAGE:return ip.APP_PAGE;case nl.IMAGE:return ip.IMAGE;case nl.APP_ROUTE:return ip.APP_ROUTE;case nl.PAGES_API:throw Object.defineProperty(Error(`Unexpected route kind ${e}`),"__NEXT_ERROR_CODE",{value:"E64",enumerable:!1,configurable:!0});default:return e}}(r.routeKind),isRoutePPREnabled:r.isRoutePPREnabled,isFallback:r.isFallback}))&&!r.isOnDemandRevalidate&&(n(i),s=!0,!i.isStale||r.isPrefetch))return i;let a=await this.revalidate(e,r.incrementalCache,r.isRoutePPREnabled,r.isFallback,t,i,null!==i&&!r.isOnDemandRevalidate);if(!a)return this.minimal_mode&&(this.previousCacheItem=void 0),null;return r.isOnDemandRevalidate,a}catch(e){if(s)return console.error(e),null;throw e}}async revalidate(e,t,r,n,i,s,a,o){return this.revalidateBatcher.batch(e,()=>{let l=this.handleRevalidate(e,t,r,n,i,s,a);return o&&o(l),l})}async handleRevalidate(e,t,r,n,i,s,a){try{let o=await i({hasResolved:a,previousCacheEntry:s,isRevalidating:!0});if(!o)return null;let l=await im({...o,isMiss:!s});return l.cacheControl&&(this.minimal_mode?this.previousCacheItem={key:e,entry:l,expiresAt:Date.now()+1e3}:await t.set(e,l.value,{cacheControl:l.cacheControl,isRoutePPREnabled:r,isFallback:n})),l}catch(i){if(null==s?void 0:s.cacheControl){let i=Math.min(Math.max(s.cacheControl.revalidate||3,3),30),a=void 0===s.cacheControl.expire?void 0:Math.max(i+3,s.cacheControl.expire);await t.set(e,s.value,{cacheControl:{revalidate:i,expire:a},isRoutePPREnabled:r,isFallback:n})}throw i}}}let iv=require("next/dist/server/lib/incremental-cache/tags-manifest.external.js");class i_{constructor(e){this.fs=e,this.tasks=[]}findOrCreateTask(e){for(let t of this.tasks)if(t[0]===e)return t;let t=this.fs.mkdir(e);t.catch(()=>{});let r=[e,t,[]];return this.tasks.push(r),r}append(e,t){let r=this.findOrCreateTask(r8().dirname(e)),n=r[1].then(()=>this.fs.writeFile(e,t));n.catch(()=>{}),r[2].push(n)}wait(){return Promise.all(this.tasks.flatMap(e=>e[2]))}}let ib=require("next/dist/server/lib/incremental-cache/memory-cache.external.js");class ix{static #e=this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;constructor(e){this.fs=e.fs,this.flushToDisk=e.flushToDisk,this.serverDistDir=e.serverDistDir,this.revalidatedTags=e.revalidatedTags,e.maxMemoryCacheSize?ix.memoryCache?ix.debug&&console.log("FileSystemCache: memory store already initialized"):(ix.debug&&console.log("FileSystemCache: using memory store for fetch cache"),ix.memoryCache=(0,ib.getMemoryCache)(e.maxMemoryCacheSize)):ix.debug&&console.log("FileSystemCache: not using memory store for fetch cache")}resetRequestCache(){}async revalidateTag(...e){let[t]=e;if(t="string"==typeof t?[t]:t,ix.debug&&console.log("FileSystemCache: revalidateTag",t),0!==t.length)for(let e of t)iv.tagsManifest.has(e)||iv.tagsManifest.set(e,Date.now())}async get(...e){var t,r,n,i,s,a,o,l,d;let[u,c]=e,{kind:h}=c,p=null==(t=ix.memoryCache)?void 0:t.get(u);if(ix.debug&&(h===ip.FETCH?console.log("FileSystemCache: get",u,c.tags,h,!!p):console.log("FileSystemCache: get",u,h,!!p)),!p)try{if(h===ip.APP_ROUTE){let e=this.getFilePath(`${u}.body`,ip.APP_ROUTE),t=await this.fs.readFile(e),{mtime:r}=await this.fs.stat(e),n=JSON.parse(await this.fs.readFile(e.replace(/\.body$/,e5),"utf8"));p={lastModified:r.getTime(),value:{kind:ih.APP_ROUTE,body:t,headers:n.headers,status:n.status}}}else{let e=this.getFilePath(h===ip.FETCH?u:`${u}.html`,h),t=await this.fs.readFile(e,"utf8"),{mtime:r}=await this.fs.stat(e);if(h===ip.FETCH){let{tags:e,fetchIdx:n,fetchUrl:i}=c;if(!this.flushToDisk)return null;let s=r.getTime(),l=JSON.parse(t);if(p={lastModified:s,value:l},(null==(a=p.value)?void 0:a.kind)===ih.FETCH){let t=null==(o=p.value)?void 0:o.tags;(null==e?void 0:e.every(e=>null==t?void 0:t.includes(e)))||(ix.debug&&console.log("FileSystemCache: tags vs storedTags mismatch",e,t),await this.set(u,p.value,{fetchCache:!0,tags:e,fetchIdx:n,fetchUrl:i}))}}else if(h===ip.APP_PAGE){let n,i,s;try{n=JSON.parse(await this.fs.readFile(e.replace(/\.html$/,e5),"utf8"))}catch{}if(null==n?void 0:n.segmentPaths){let e=new Map;i=e;let t=u+e2;await Promise.all(n.segmentPaths.map(async r=>{let n=this.getFilePath(t+r+e9,ip.APP_PAGE);try{e.set(r,await this.fs.readFile(n))}catch{}}))}c.isFallback||(s=await this.fs.readFile(this.getFilePath(`${u}${c.isRoutePPREnabled?e4:e3}`,ip.APP_PAGE))),p={lastModified:r.getTime(),value:{kind:ih.APP_PAGE,html:t,rscData:s,postponed:null==n?void 0:n.postponed,headers:null==n?void 0:n.headers,status:null==n?void 0:n.status,segmentData:i}}}else if(h===ip.PAGES){let e,n={};c.isFallback||(n=JSON.parse(await this.fs.readFile(this.getFilePath(`${u}${e8}`,ip.PAGES),"utf8"))),p={lastModified:r.getTime(),value:{kind:ih.PAGES,html:t,pageData:n,headers:null==e?void 0:e.headers,status:null==e?void 0:e.status}}}else throw Object.defineProperty(Error(`Invariant: Unexpected route kind ${h} in file system cache.`),"__NEXT_ERROR_CODE",{value:"E445",enumerable:!1,configurable:!0})}p&&(null==(l=ix.memoryCache)||l.set(u,p))}catch{return null}if("allowStale"in c&&c.allowStale)return ix.debug&&console.log("FileSystemCache: allow stale",c.allowStale),p??null;if((null==p||null==(r=p.value)?void 0:r.kind)===ih.APP_PAGE||(null==p||null==(n=p.value)?void 0:n.kind)===ih.APP_ROUTE||(null==p||null==(i=p.value)?void 0:i.kind)===ih.PAGES){let e=null==(d=p.value.headers)?void 0:d[e6];if("string"==typeof e){let t=e.split(",");if(t.length>0&&(0,iv.isStale)(t,p.lastModified))return ix.debug&&console.log("FileSystemCache: stale tags",t),null}}else if((null==p||null==(s=p.value)?void 0:s.kind)===ih.FETCH){let e=c.kind===ip.FETCH?[...c.tags||[],...c.softTags||[]]:[];if(e.some(e=>this.revalidatedTags.includes(e)))return ix.debug&&console.log("FileSystemCache: was revalidated",e),null;if((0,iv.isStale)(e,p.lastModified))return ix.debug&&console.log("FileSystemCache: stale tags",e),null}return p??null}async set(e,t,r){var n;if(null==(n=ix.memoryCache)||n.set(e,{value:t,lastModified:Date.now()}),ix.debug&&console.log("FileSystemCache: set",e),!this.flushToDisk||!t)return;let i=new i_(this.fs);if(t.kind===ih.APP_ROUTE){let r=this.getFilePath(`${e}.body`,ip.APP_ROUTE);i.append(r,t.body);let n={headers:t.headers,status:t.status,postponed:void 0,segmentPaths:void 0};i.append(r.replace(/\.body$/,e5),JSON.stringify(n,null,2))}else if(t.kind===ih.PAGES||t.kind===ih.APP_PAGE){let n=t.kind===ih.APP_PAGE,s=this.getFilePath(`${e}.html`,n?ip.APP_PAGE:ip.PAGES);if(i.append(s,t.html),r.fetchCache||r.isFallback||i.append(this.getFilePath(`${e}${n?r.isRoutePPREnabled?e4:e3:e8}`,n?ip.APP_PAGE:ip.PAGES),n?t.rscData:JSON.stringify(t.pageData)),(null==t?void 0:t.kind)===ih.APP_PAGE){let e;if(t.segmentData){e=[];let r=s.replace(/\.html$/,e2);for(let[n,s]of t.segmentData){e.push(n);let t=r+n+e9;i.append(t,s)}}let r={headers:t.headers,status:t.status,postponed:t.postponed,segmentPaths:e};i.append(s.replace(/\.html$/,e5),JSON.stringify(r))}}else if(t.kind===ih.FETCH){let n=this.getFilePath(e,ip.FETCH);i.append(n,JSON.stringify({...t,tags:r.fetchCache?r.tags:[]}))}await i.wait()}getFilePath(e,t){switch(t){case ip.FETCH:return r8().join(this.serverDistDir,"..","cache","fetch-cache",e);case ip.PAGES:return r8().join(this.serverDistDir,"pages",e);case ip.IMAGE:case ip.APP_PAGE:case ip.APP_ROUTE:return r8().join(this.serverDistDir,"app",e);default:throw Object.defineProperty(Error(`Unexpected file path kind: ${t}`),"__NEXT_ERROR_CODE",{value:"E479",enumerable:!1,configurable:!0})}}}let iE=require("next/dist/server/lib/incremental-cache/shared-cache-controls.external.js");class iw{static #e=this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;constructor({fs:e,dev:t,flushToDisk:r,minimalMode:n,serverDistDir:i,requestHeaders:s,maxMemoryCacheSize:a,getPrerenderManifest:o,fetchCacheKeyPrefix:l,CurCacheHandler:d,allowedRevalidateHeaderKeys:u}){var c,h,p,f;this.locks=new Map,this.hasCustomCacheHandler=!!d;let m=Symbol.for("@next/cache-handlers"),g=globalThis;if(d)iw.debug&&console.log("IncrementalCache: using custom cache handler",d.name);else{let t=g[m];(null==t?void 0:t.FetchCache)?d=t.FetchCache:e&&i&&(iw.debug&&console.log("IncrementalCache: using filesystem cache handler"),d=ix)}process.env.__NEXT_TEST_MAX_ISR_CACHE&&(a=parseInt(process.env.__NEXT_TEST_MAX_ISR_CACHE,10)),this.dev=t,this.disableForTestmode="true"===process.env.NEXT_PRIVATE_TEST_PROXY,this.minimalMode=n,this.requestHeaders=s,this.allowedRevalidateHeaderKeys=u,this.prerenderManifest=o(),this.cacheControls=new iE.SharedCacheControls(this.prerenderManifest),this.fetchCacheKeyPrefix=l;let y=[];s["x-prerender-revalidate"]===(null==(h=this.prerenderManifest)||null==(c=h.preview)?void 0:c.previewModeId)&&(this.isOnDemandRevalidate=!0),n&&(y=this.revalidatedTags=rK(s,null==(f=this.prerenderManifest)||null==(p=f.preview)?void 0:p.previewModeId)),d&&(this.cacheHandler=new d({dev:t,fs:e,flushToDisk:r,serverDistDir:i,revalidatedTags:y,maxMemoryCacheSize:a,_requestHeaders:s,fetchCacheKeyPrefix:l}))}calculateRevalidate(e,t,r,n){if(r)return Math.floor(performance.timeOrigin+performance.now()-1e3);let i=this.cacheControls.get(nN(e)),s=i?i.revalidate:!n&&1;return"number"==typeof s?1e3*s+t:s}_getPathname(e,t){return t?e:r6(e)}resetRequestCache(){var e,t;null==(t=this.cacheHandler)||null==(e=t.resetRequestCache)||e.call(t)}async lock(e){for(;;){let t=this.locks.get(e);if(iw.debug&&console.log("IncrementalCache: lock get",e,!!t),!t)break;await t}let{resolve:t,promise:r}=new rc;return iw.debug&&console.log("IncrementalCache: successfully locked",e),this.locks.set(e,r),()=>{t(),this.locks.delete(e)}}async revalidateTag(e){var t;return null==(t=this.cacheHandler)?void 0:t.revalidateTag(e)}async generateCacheKey(e,t={}){let n=[],i=new TextEncoder,s=new TextDecoder;if(t.body)if(t.body instanceof Uint8Array)n.push(s.decode(t.body)),t._ogBody=t.body;else if("function"==typeof t.body.getReader){let e=t.body,r=[];try{await e.pipeTo(new WritableStream({write(e){"string"==typeof e?(r.push(i.encode(e)),n.push(e)):(r.push(e),n.push(s.decode(e,{stream:!0})))}})),n.push(s.decode());let a=r.reduce((e,t)=>e+t.length,0),o=new Uint8Array(a),l=0;for(let e of r)o.set(e,l),l+=e.length;t._ogBody=o}catch(e){console.error("Problem reading body",e)}}else if("function"==typeof t.body.keys){let e=t.body;for(let r of(t._ogBody=t.body,new Set([...e.keys()]))){let t=e.getAll(r);n.push(`${r}=${(await Promise.all(t.map(async e=>"string"==typeof e?e:await e.text()))).join(",")}`)}}else if("function"==typeof t.body.arrayBuffer){let e=t.body,r=await e.arrayBuffer();n.push(await e.text()),t._ogBody=new Blob([r],{type:e.type})}else"string"==typeof t.body&&(n.push(t.body),t._ogBody=t.body);let a="function"==typeof(t.headers||{}).keys?Object.fromEntries(t.headers):Object.assign({},t.headers);"traceparent"in a&&delete a.traceparent,"tracestate"in a&&delete a.tracestate;let o=JSON.stringify(["v3",this.fetchCacheKeyPrefix||"",e,t.method,a,t.mode,t.redirect,t.credentials,t.referrer,t.referrerPolicy,t.integrity,t.cache,n]);return r("crypto").createHash("sha256").update(o).digest("hex")}async get(e,t){var r,n,i,s,a,o,l;let d,u;if(t.kind===ip.FETCH){let t=j.workUnitAsyncStorage.getStore(),r=t?(0,j.getRenderResumeDataCache)(t):null;if(r){let t=r.fetch.get(e);if((null==t?void 0:t.kind)===ih.FETCH)return iw.debug&&console.log("IncrementalCache: rdc:hit",e),{isStale:!1,value:t};iw.debug&&console.log("IncrementalCache: rdc:miss",e)}else iw.debug&&console.log("IncrementalCache: rdc:no-resume-data")}if(this.disableForTestmode||this.dev&&(t.kind!==ip.FETCH||"no-cache"===this.requestHeaders["cache-control"]))return null;e=this._getPathname(e,t.kind===ip.FETCH);let c=await (null==(r=this.cacheHandler)?void 0:r.get(e,t));if(t.kind===ip.FETCH){if(!c)return null;if((null==(i=c.value)?void 0:i.kind)!==ih.FETCH)throw Object.defineProperty(new eh(`Expected cached value for cache key ${JSON.stringify(e)} to be a "FETCH" kind, got ${JSON.stringify(null==(s=c.value)?void 0:s.kind)} instead.`),"__NEXT_ERROR_CODE",{value:"E653",enumerable:!1,configurable:!0});let r=eu.workAsyncStorage.getStore();if([...t.tags||[],...t.softTags||[]].some(e=>{var t,n;return(null==(t=this.revalidatedTags)?void 0:t.includes(e))||(null==r||null==(n=r.pendingRevalidatedTags)?void 0:n.includes(e))}))return iw.debug&&console.log("IncrementalCache: stale tag",e),null;let n=j.workUnitAsyncStorage.getStore();if(n){let t=(0,j.getPrerenderResumeDataCache)(n);t&&(iw.debug&&console.log("IncrementalCache: rdc:set",e),t.fetch.set(e,c.value))}let a=t.revalidate||c.value.revalidate,o=(performance.timeOrigin+performance.now()-(c.lastModified||0))/1e3,l=c.value.data;return{isStale:o>a,value:{kind:ih.FETCH,data:l,revalidate:a}}}if((null==c||null==(n=c.value)?void 0:n.kind)===ih.FETCH)throw Object.defineProperty(new eh(`Expected cached value for cache key ${JSON.stringify(e)} not to be a ${JSON.stringify(t.kind)} kind, got "FETCH" instead.`),"__NEXT_ERROR_CODE",{value:"E652",enumerable:!1,configurable:!0});let h=null,p=this.cacheControls.get(nN(e));if((null==c?void 0:c.lastModified)===-1)d=-1,u=-31536e3;else{let r=performance.timeOrigin+performance.now(),n=(null==c?void 0:c.lastModified)||r;if(void 0===(d=!1!==(u=this.calculateRevalidate(e,n,this.dev??!1,t.isFallback))&&u<r||void 0)&&((null==c||null==(a=c.value)?void 0:a.kind)===ih.APP_PAGE||(null==c||null==(o=c.value)?void 0:o.kind)===ih.APP_ROUTE)){let e=null==(l=c.value.headers)?void 0:l[e6];if("string"==typeof e){let t=e.split(",");t.length>0&&(0,iv.isStale)(t,n)&&(d=-1)}}}return c&&(h={isStale:d,cacheControl:p,revalidateAfter:u,value:c.value}),!c&&this.prerenderManifest.notFoundRoutes.includes(e)&&(h={isStale:d,value:null,cacheControl:p,revalidateAfter:u},this.set(e,h.value,{...t,cacheControl:p})),h}async set(e,t,r){if((null==t?void 0:t.kind)===ih.FETCH){let r=j.workUnitAsyncStorage.getStore(),n=r?(0,j.getPrerenderResumeDataCache)(r):null;n&&(iw.debug&&console.log("IncrementalCache: rdc:set",e),n.fetch.set(e,t))}if(this.disableForTestmode||this.dev&&!r.fetchCache)return;e=this._getPathname(e,r.fetchCache);let n=JSON.stringify(t).length;if(r.fetchCache&&n>2097152&&!this.hasCustomCacheHandler&&!r.isImplicitBuildTimeCache){let t=`Failed to set Next.js data cache for ${r.fetchUrl||e}, items over 2MB can not be cached (${n} bytes)`;if(this.dev)throw Object.defineProperty(Error(t),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});console.warn(t);return}try{var i;!r.fetchCache&&r.cacheControl&&this.cacheControls.set(nN(e),r.cacheControl),await (null==(i=this.cacheHandler)?void 0:i.set(e,t,r))}catch(t){console.warn("Failed to update prerender cache for",e,t)}}}let iC=require("http"),iR=require("https"),iP={existsSync:eO().existsSync,readFile:eO().promises.readFile,readFileSync:eO().readFileSync,writeFile:(e,t)=>eO().promises.writeFile(e,t),mkdir:e=>eO().promises.mkdir(e,{recursive:!0}),stat:e=>eO().promises.stat(e)};class iT extends id().Readable{constructor({url:e,headers:t,method:r,socket:n=null,readable:i}){super(),this.httpVersion="1.0",this.httpVersionMajor=1,this.httpVersionMinor=0,this.socket=new Proxy({},{get:(e,t)=>{if("encrypted"!==t&&"remoteAddress"!==t)throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0});if("remoteAddress"!==t)return!1}}),this.url=e,this.headers=t,this.method=r,i&&(this.bodyReadable=i,this.bodyReadable.on("end",()=>this.emit("end")),this.bodyReadable.on("close",()=>this.emit("close"))),n&&(this.socket=n)}get headersDistinct(){let e={};for(let[t,r]of Object.entries(this.headers))r&&(e[t]=Array.isArray(r)?r:[r]);return e}_read(e){if(this.bodyReadable)return this.bodyReadable._read(e);this.emit("end"),this.emit("close")}get connection(){return this.socket}get aborted(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0})}get complete(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0})}get trailers(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0})}get trailersDistinct(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0})}get rawTrailers(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0})}get rawHeaders(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}setTimeout(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}}class iO extends id().Writable{constructor(e={}){super(),this.statusMessage="",this.finished=!1,this.headersSent=!1,this.buffers=[],this.statusCode=e.statusCode??200,this.socket=e.socket??null,this.headers=e.headers?function(e){let t=new Headers;for(let[r,n]of Object.entries(e))for(let e of Array.isArray(n)?n:[n])void 0!==e&&("number"==typeof e&&(e=e.toString()),t.append(r,e));return t}(e.headers):new Headers,this.headPromise=new Promise(e=>{this.headPromiseResolve=e}),this.hasStreamed=new Promise((e,t)=>{this.on("finish",()=>e(!0)),this.on("end",()=>e(!0)),this.on("error",e=>t(e))}).then(e=>(null==this.headPromiseResolve||this.headPromiseResolve.call(this),e)),e.resWriter&&(this.resWriter=e.resWriter)}appendHeader(e,t){for(let r of Array.isArray(t)?t:[t])this.headers.append(e,r);return this}get isSent(){return this.finished||this.headersSent}get connection(){return this.socket}write(e){return this.resWriter?this.resWriter(e):(this.buffers.push(Buffer.isBuffer(e)?e:Buffer.from(e)),!0)}end(){return this.finished=!0,super.end(...arguments)}_implicitHeader(){}_write(e,t,r){this.write(e),r()}writeHead(e,t,r){if(r||"string"==typeof t?"string"==typeof t&&t.length>0&&(this.statusMessage=t):r=t,r)if(Array.isArray(r))for(let e=0;e<r.length;e+=2)this.setHeader(r[e],r[e+1]);else for(let[e,t]of Object.entries(r))void 0!==t&&this.setHeader(e,t);return this.statusCode=e,this.headersSent=!0,null==this.headPromiseResolve||this.headPromiseResolve.call(this),this}hasHeader(e){return this.headers.has(e)}getHeader(e){return this.headers.get(e)??void 0}getHeaders(){return tK(this.headers)}getHeaderNames(){return Array.from(this.headers.keys())}setHeader(e,t){if(Array.isArray(t))for(let r of(this.headers.delete(e),t))this.headers.append(e,r);else"number"==typeof t?this.headers.set(e,t.toString()):this.headers.set(e,t);return this}removeHeader(e){this.headers.delete(e)}flushHeaders(){}get strictContentLength(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}writeEarlyHints(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get req(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}assignSocket(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}detachSocket(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}writeContinue(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}writeProcessing(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get upgrading(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get chunkedEncoding(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get shouldKeepAlive(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get useChunkedEncodingByDefault(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get sendDate(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}setTimeout(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}addTrailers(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}setHeaders(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}}let iS=(e,t)=>{let r=_().isAbsolute(t)?t:_().join(e,t);return(0,b.pathToFileURL)(r).toString()};class iI{add(e){this.callbacks.push(e)}async runAll(){if(!this.callbacks.length)return;let e=this.callbacks;this.callbacks=[],await Promise.allSettled(e.map(async e=>e()))}constructor(){this.callbacks=[]}}let ik=Symbol.for("react.postpone");function iA(e){return"object"==typeof e&&null!==e&&e.$$typeof===ik}class ij{async load(e){return await require(e)}}let iN=require("next/dist/server/lib/router-utils/instrumentation-globals.external.js"),iD=Symbol.for("@next/router-server-methods"),i$=globalThis,iM=e=>import(e).then(e=>e.default||e),iZ=new WeakMap;class iL extends n0{constructor(e){var t,r,n;super(e),this.cleanupListeners=new iI,this.handleNextImageRequest=async(e,t,r)=>!(!r.pathname||!r.pathname.startsWith("/_next/image")||eM(e,"middlewareInvoke"))&&(t.statusCode=400,t.body("Bad Request").send(),!0),this.handleCatchallRenderRequest=async(e,t,r)=>{let{pathname:n,query:i}=r;if(!n)throw Object.defineProperty(Error("Invariant: pathname is undefined"),"__NEXT_ERROR_CODE",{value:"E409",enumerable:!1,configurable:!0});eZ(e,"bubbleNoFallback",void 0),i$[iD]||(i$[iD]={});let s=(0,v.relative)(process.cwd(),this.dir);i$[iD][s]||(i$[iD][s]={render404:this.render404.bind(this)}),i$[iD][s].nextConfig=this.nextConfig;try{var a;n=tQ(n);let s={i18n:null==(a=this.i18nProvider)?void 0:a.fromRequest(e,n)},o=await this.matchers.match(n,s);if(!o)return await this.render(e,t,n,i,r,!0),!0;for(let n of(eZ(e,"match",o),this.getEdgeFunctionsPages()))if(n===o.definition.page){if("export"===this.nextConfig.output)return await this.render404(e,t,r),!0;delete i[rX];try{if(await this.runEdgeFunction({req:e,res:t,query:i,params:o.params,page:o.definition.page,match:o,appPaths:null}))return!0}catch(t){throw await this.instrumentationOnRequestError(t,e,{routePath:o.definition.page,routerKind:"Pages Router",routeType:"route",revalidateReason:void 0}),t}}if(o.definition.kind===nl.PAGES_API){if("export"===this.nextConfig.output)return await this.render404(e,t,r),!0;if(await this.handleApiRequest(e,t,i,o))return!0}return await this.render(e,t,n,i,r,!0),!0}catch(r){if(r instanceof nK.NoFallbackError)throw r;try{return this.logError(r),t.statusCode=500,await this.renderError(r,e,t,n,i),!0}catch{}throw r}},this.handleCatchallMiddlewareRequest=async(e,t,r)=>{let n,i=eM(e,"middlewareInvoke");if(!i)return!1;let s=()=>(eZ(e,"middlewareInvoke",!0),t.body("").send(),!0),a=await this.getMiddleware();if(!a)return s();let o=tf(eM(e,"initURL")),l=t6(o.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});o.pathname=l.pathname;let d=tQ(r.pathname||""),u=d;try{u=decodeURIComponent(d)}catch{}if(!(a.match(d,e,o.query)||a.match(u,e,o.query)))return s();let c=!1;try{if(await this.ensureMiddleware(e.url),n=await this.runMiddleware({request:e,response:t,parsedUrl:o,parsed:r}),"response"in n){if(i)throw c=!0,Object.defineProperty(new tt.BubbledError(!0,n),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});for(let[e,r]of Object.entries(tK(n.response.headers)))"content-encoding"!==e&&void 0!==r&&t.setHeader(e,r);t.statusCode=n.response.status;let{originalResponse:e}=t;return n.response.body?await r_(n.response.body,e):e.end(),!0}}catch(i){if(c)throw i;if(rY(i)&&"ENOENT"===i.code)return await this.render404(e,t,r),!0;if(i instanceof ew)return t.statusCode=400,await this.renderError(i,e,t,r.pathname||""),!0;let n=rJ(i);return console.error(n),t.statusCode=500,await this.renderError(n,e,t,r.pathname||""),!0}return n.finished};let i=e.dev??!1;if(this.isDev=i,this.sriEnabled=!!(null==(r=e.conf.experimental)||null==(t=r.sri)?void 0:t.algorithm),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.experimental.useSkewCookie?"":this.nextConfig.deploymentId||"",e.dev,!e.dev){let{dynamicRoutes:e=[]}=this.getRoutesManifest()??{};this.dynamicRoutes=e.map(e=>{let t=rS(e.page);return{match:eD(t),page:e.page,re:t.re}})}!function(e){if(!globalThis.__NEXT_HTTP_AGENT){if(!e)throw Object.defineProperty(Error("Expected config.httpAgentOptions to be an object"),"__NEXT_ERROR_CODE",{value:"E204",enumerable:!1,configurable:!0});globalThis.__NEXT_HTTP_AGENT_OPTIONS=e.httpAgentOptions,globalThis.__NEXT_HTTP_AGENT=new iC.Agent(e.httpAgentOptions),globalThis.__NEXT_HTTPS_AGENT=new iR.Agent(e.httpAgentOptions)}}(this.nextConfig),this.middlewareManifestPath=(0,v.join)(this.serverDistDir,"middleware-manifest.json"),e.dev||this.prepare().catch(e=>{console.error("Failed to prepare server",e)}),this.renderOpts.isExperimentalCompile&&function(e){let t={...function(){let e=[];for(let t in process.env)if(t.startsWith("NEXT_PUBLIC_")){let r=process.env[t];null!=r&&e.push([`process.env.${t}`,r])}return e.sort((e,t)=>e[0].localeCompare(t[0])),Object.fromEntries(e)}(),...function(e){let t={},r=e.env;for(let n in r){let i=r[n];if(null!=i){let r=/^(?:NODE_.+)|^(?:__.+)$/i.test(n),s="NEXT_RUNTIME"===n;if(r||s)throw Object.defineProperty(Error(`The key "${n}" under "env" in ${e.configFileName} is not allowed. https://nextjs.org/docs/messages/env-key-not-allowed`),"__NEXT_ERROR_CODE",{value:"E170",enumerable:!1,configurable:!0});t[`process.env.${n}`]=i}}return t}(e),"process.env.NEXT_DEPLOYMENT_ID":e.deploymentId||""};for(let e in t){let r=e.split(".").pop()||"";process.env[r]||(process.env[r]=t[e]||"")}}(this.nextConfig),(null==(n=e.conf.experimental)?void 0:n.removeUncaughtErrorAndRejectionListeners)&&(process.removeAllListeners("uncaughtException"),process.removeAllListeners("unhandledRejection")),process.on("unhandledRejection",e=>{iA(e)||console.error(e)}),process.on("rejectionHandled",()=>{}),process.on("uncaughtException",e=>{iA(e)||console.error(e)})}async unstable_preloadEntries(){await this.prepare();let e=this.getAppPathsManifest(),t=this.getPagesManifest();for(let e of(await this.loadCustomCacheHandlers(),Object.keys(t||{})))try{await is({distDir:this.distDir,page:e,isAppPath:!1,isDev:this.isDev,sriEnabled:this.sriEnabled,needsManifestsForLegacyReasons:!1})}catch(e){}for(let t of Object.keys(e||{}))try{let{ComponentMod:e}=await is({distDir:this.distDir,page:t,isAppPath:!0,isDev:this.isDev,sriEnabled:this.sriEnabled,needsManifestsForLegacyReasons:!1});e.patchFetch()}catch(e){}}async handleUpgrade(){}async loadInstrumentationModule(){if(!this.serverOptions.dev)try{this.instrumentation=await (0,iN.getInstrumentationModule)(this.dir,this.nextConfig.distDir)}catch(e){if("MODULE_NOT_FOUND"!==e.code)throw Object.defineProperty(Error("An error occurred while loading the instrumentation hook",{cause:e}),"__NEXT_ERROR_CODE",{value:"E92",enumerable:!1,configurable:!0})}return this.instrumentation}async prepareImpl(){await super.prepareImpl(),await this.runInstrumentationHookIfAvailable()}async runInstrumentationHookIfAvailable(){await (0,iN.ensureInstrumentationRegistered)(this.dir,this.nextConfig.distDir)}loadEnvConfig({dev:e,forceReload:t,silent:r}){(0,io.loadEnvConfig)(this.dir,e,r?{info:()=>{},error:()=>{}}:g,t)}async loadCustomCacheHandlers(){let{cacheHandlers:e}=this.nextConfig.experimental;if(e&&function(){if(nW[nH])return null==nz||nz("cache handlers already initialized"),!1;if(null==nz||nz("initializing cache handlers"),nW[nH]=new Map,nW[nF]){let e;nW[nF].DefaultCache?(null==nz||nz('setting "default" cache handler from symbol'),e=nW[nF].DefaultCache):(null==nz||nz('setting "default" cache handler from default'),e=nU()),nW[nH].set("default",e),nW[nF].RemoteCache?(null==nz||nz('setting "remote" cache handler from symbol'),nW[nH].set("remote",nW[nF].RemoteCache)):(null==nz||nz('setting "remote" cache handler from default'),nW[nH].set("remote",e))}else null==nz||nz('setting "default" cache handler from default'),nW[nH].set("default",nU()),null==nz||nz('setting "remote" cache handler from default'),nW[nH].set("remote",nU());return nW[nV]=new Set(nW[nH].values()),!0}()){for(let[r,n]of Object.entries(e))if(n){var t=n8(await iM(iS(this.distDir,n)));if(!nW[nH]||!nW[nV])throw Object.defineProperty(Error("Cache handlers not initialized"),"__NEXT_ERROR_CODE",{value:"E649",enumerable:!1,configurable:!0});null==nz||nz('setting cache handler for "%s"',r),nW[nH].set(r,t),nW[nV].add(t)}}}async getIncrementalCache({requestHeaders:e}){let t,{cacheHandler:r}=this.nextConfig;return r&&(t=n8(await iM(iS(this.distDir,r)))),await this.loadCustomCacheHandlers(),new iw({fs:this.getCacheFilesystem(),dev:!1,requestHeaders:e,allowedRevalidateHeaderKeys:this.nextConfig.experimental.allowedRevalidateHeaderKeys,minimalMode:!0,serverDistDir:this.serverDistDir,fetchCacheKeyPrefix:this.nextConfig.experimental.fetchCacheKeyPrefix,maxMemoryCacheSize:this.nextConfig.cacheMaxMemorySize,flushToDisk:!1,getPrerenderManifest:()=>this.getPrerenderManifest(),CurCacheHandler:t})}getResponseCache(){return new iy(!0)}getPublicDir(){return(0,v.join)(this.dir,"public")}getHasStaticDir(){return eO().existsSync((0,v.join)(this.dir,"static"))}getPagesManifest(){return(0,n1.loadManifest)((0,v.join)(this.serverDistDir,eF))}getAppPathsManifest(){if(this.enabledDirectories.app)return(0,n1.loadManifest)((0,v.join)(this.serverDistDir,eH))}getinterceptionRoutePatterns(){if(!this.enabledDirectories.app)return[];let e=this.getRoutesManifest();return(null==e?void 0:e.rewrites.beforeFiles.filter(rB).map(e=>new RegExp(e.regex)))??[]}async hasPage(e){var t;return!!n2(e,this.distDir,null==(t=this.nextConfig.i18n)?void 0:t.locales,this.enabledDirectories.app)}getBuildId(){let e=(0,v.join)(this.distDir,"BUILD_ID");try{return eO().readFileSync(e,"utf8").trim()}catch(e){if("ENOENT"===e.code)throw Object.defineProperty(Error(`Could not find a production build in the '${this.distDir}' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id`),"__NEXT_ERROR_CODE",{value:"E427",enumerable:!1,configurable:!0});throw e}}getEnabledDirectories(e){let t=e?this.dir:this.serverDistDir;return{app:!!eB(t,"app"),pages:!!eB(t,"pages")}}sendRenderResult(e,t,r){return tc({req:e.originalRequest,res:t.originalResponse,result:r.result,generateEtags:r.generateEtags,poweredByHeader:r.poweredByHeader,cacheControl:r.cacheControl})}async runApi(e,t,r,n){for(let i of this.getEdgeFunctionsPages())if(i===n.definition.pathname&&await this.runEdgeFunction({req:e,res:t,query:r,params:n.params,page:n.definition.pathname,appPaths:null}))return!0;let i=tf(eM(e,"initURL")||e.url);e.url=`${i.pathname}${i.search||""}`;let s=new ij,a=await s.load(n.definition.filename);return eZ(e.originalRequest,"relativeProjectDir",(0,v.relative)(process.cwd(),this.dir)),eZ(e.originalRequest,"distDir",this.distDir),await a.handler(e.originalRequest,t.originalResponse,{waitUntil:this.getWaitUntil()}),!0}async renderHTML(e,t,r,n,i){return(0,tt.getTracer)().trace(rf.renderHTML,async()=>this.renderHTMLImpl(e,t,r,n,i))}async renderHTMLImpl(e,t,r,n,i){throw Object.defineProperty(Error("Invariant: renderHTML should not be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E472",enumerable:!1,configurable:!0})}async imageOptimizer(e,t,r,n){throw Object.defineProperty(Error("invariant: imageOptimizer should not be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E506",enumerable:!1,configurable:!0})}getPagePath(e,t){return n9(e,this.distDir,t,this.enabledDirectories.app)}async renderPageComponent(e,t){let r=this.getEdgeFunctionsPages()||[];if(r.length){let t=this.getOriginalAppPaths(e.pathname),n=Array.isArray(t),i=e.pathname;for(let s of(n&&(i=t[0]),r))if(s===i)return await this.runEdgeFunction({req:e.req,res:e.res,query:e.query,params:e.renderOpts.params,page:i,appPaths:t}),null}return super.renderPageComponent(e,t)}async findPageComponents({locale:e,page:t,query:r,params:n,isAppPath:i,url:s}){return(0,tt.getTracer)().trace(rf.findPageComponents,{spanName:"resolve page components",attributes:{"next.route":i?tj(t):t}},()=>this.findPageComponentsImpl({locale:e,page:t,query:r,params:n,isAppPath:i,url:s}))}async findPageComponentsImpl({locale:e,page:t,query:r,params:n,isAppPath:i,url:s}){let a=[t];for(let s of(r.amp&&a.unshift((i?tj(t):r6(t))+".amp"),e&&a.unshift(...a.map(t=>`/${e}${"/"===t?"":t}`)),a))try{let t=await is({distDir:this.distDir,page:s,isAppPath:i,isDev:this.isDev,sriEnabled:this.sriEnabled,needsManifestsForLegacyReasons:!1});if(e&&"string"==typeof t.Component&&!s.startsWith(`/${e}/`)&&s!==`/${e}`)continue;return{components:t,query:{...!this.renderOpts.isExperimentalCompile&&t.getStaticProps?{amp:r.amp}:r,...(i?{}:n)||{}}}}catch(e){if(!(e instanceof eR))throw e}return null}getNextFontManifest(){return(0,n1.loadManifest)((0,v.join)(this.distDir,"server","next-font-manifest.json"))}logErrorWithOriginalStack(e,t){throw Object.defineProperty(Error("Invariant: logErrorWithOriginalStack can only be called on the development server"),"__NEXT_ERROR_CODE",{value:"E6",enumerable:!1,configurable:!0})}async ensurePage(e){throw Object.defineProperty(Error("Invariant: ensurePage can only be called on the development server"),"__NEXT_ERROR_CODE",{value:"E291",enumerable:!1,configurable:!0})}async handleApiRequest(e,t,r,n){return this.runApi(e,t,r,n)}getCacheFilesystem(){return iP}normalizeReq(e){return e instanceof to?e:new to(e)}normalizeRes(e){return e instanceof tl?e:new tl(e)}getRequestHandler(){return this.makeRequestHandler()}makeRequestHandler(){this.prepare().catch(e=>{console.error("Failed to prepare server",e)});let e=super.getRequestHandler();return(t,r,n)=>e(this.normalizeReq(t),this.normalizeRes(r),n)}async revalidate({urlPath:e,revalidateHeaders:t,opts:r}){let n=function({url:e,headers:t={},method:r="GET",bodyReadable:n,resWriter:i,socket:s=null}){return{req:new iT({url:e,headers:t,method:r,socket:s,readable:n}),res:new iO({socket:s,resWriter:i})}}({url:e,headers:t}),i=this.getRequestHandler();if(await i(new to(n.req),new tl(n.res)),await n.res.hasStreamed,"REVALIDATED"!==n.res.getHeader("x-nextjs-cache")&&200!==n.res.statusCode&&!(404===n.res.statusCode&&r.unstable_onlyGenerated))throw Object.defineProperty(Error(`Invalid response ${n.res.statusCode}`),"__NEXT_ERROR_CODE",{value:"E175",enumerable:!1,configurable:!0})}async render(e,t,r,n,i,s=!1){return super.render(this.normalizeReq(e),this.normalizeRes(t),r,n,i,s)}async renderToHTML(e,t,r,n){return super.renderToHTML(this.normalizeReq(e),this.normalizeRes(t),r,n)}async renderErrorToResponseImpl(e,t){let{req:r,res:n,query:i}=e;return 404===n.statusCode&&this.enabledDirectories.app&&this.getEdgeFunctionsPages().includes(eU)?(await this.runEdgeFunction({req:r,res:n,query:i||{},params:{},page:eU,appPaths:null}),null):super.renderErrorToResponseImpl(e,t)}async renderError(e,t,r,n,i,s){return super.renderError(e,this.normalizeReq(t),this.normalizeRes(r),n,i,s)}async renderErrorToHTML(e,t,r,n,i){return super.renderErrorToHTML(e,this.normalizeReq(t),this.normalizeRes(r),n,i)}async render404(e,t,r,n){return super.render404(this.normalizeReq(e),this.normalizeRes(t),r,n)}getMiddlewareManifest(){return null}async getMiddleware(){var e,t;let r=this.getMiddlewareManifest(),n=null==r||null==(e=r.middleware)?void 0:e["/"];if(!n){let e=await this.loadNodeMiddleware();return e?{match:ia((null==(t=e.config)?void 0:t.matchers)||[{regexp:".*",originalSource:"/:path*"}]),page:"/"}:void 0}return{match:function(e){let t=iZ.get(e);if(t)return t;if(!Array.isArray(e.matchers))throw Object.defineProperty(Error(`Invariant: invalid matchers for middleware ${JSON.stringify(e)}`),"__NEXT_ERROR_CODE",{value:"E257",enumerable:!1,configurable:!0});let r=ia(e.matchers);return iZ.set(e,r),r}(n),page:"/"}}getEdgeFunctionsPages(){let e=this.getMiddlewareManifest();return e?Object.keys(e.functions):[]}getEdgeFunctionInfo(e){let t,r=this.getMiddlewareManifest();if(!r)return null;try{t=rE(r6(e.page))}catch(e){return null}let n=e.middleware?r.middleware[t]:r.functions[t];if(!n){if(!e.middleware)throw new eR(t);return null}return{name:n.name,paths:n.files.map(e=>(0,v.join)(this.distDir,e)),wasm:(n.wasm??[]).map(e=>({...e,filePath:(0,v.join)(this.distDir,e.filePath)})),assets:n.assets&&n.assets.map(e=>({...e,filePath:(0,v.join)(this.distDir,e.filePath)})),env:n.env}}async loadNodeMiddleware(){}async hasMiddleware(e){let t=this.getEdgeFunctionInfo({page:e,middleware:!0}),r=await this.loadNodeMiddleware();return!t&&!!r||!!(t&&t.paths.length>0)}async ensureMiddleware(e){}async ensureEdgeFunction(e){}async runMiddleware(e){throw Object.defineProperty(Error("invariant: runMiddleware should not be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E276",enumerable:!1,configurable:!0})}getPrerenderManifest(){return this._cachedPreviewManifest||(this._cachedPreviewManifest=(0,n1.loadManifest)((0,v.join)(this.distDir,"prerender-manifest.json"))),this._cachedPreviewManifest}getRoutesManifest(){return(0,tt.getTracer)().trace(rf.getRoutesManifest,()=>(0,n1.loadManifest)((0,v.join)(this.distDir,"routes-manifest.json")))}attachRequestMeta(e,t,r){var n;let i=(null==(n=e.headers["x-forwarded-proto"])?void 0:n.includes("https"))?"https":"http",s=this.fetchHostname&&this.port?`${i}://${this.fetchHostname}:${this.port}${e.url}`:this.nextConfig.experimental.trustHostHeader?`https://${e.headers.host||"localhost"}${e.url}`:e.url;eZ(e,"initURL",s),eZ(e,"initQuery",{...t.query}),eZ(e,"initProtocol",i),r||eZ(e,"clonableBody",function(e){let t=null,r=new Promise((t,r)=>{e.on("end",t),e.on("error",r)}).catch(e=>({error:e}));return{async finalize(){if(t){let n=await r;if(n&&"object"==typeof n&&n.error)throw n.error;!function(e,t){for(let r in t){let n=t[r];"function"==typeof n&&(n=n.bind(e)),e[r]=n}}(e,t),t=e}},cloneBodyStream(){let r=t??e,n=new il.PassThrough,i=new il.PassThrough;return r.on("data",e=>{n.push(e),i.push(e)}),r.on("end",()=>{n.push(null),i.push(null)}),t=i,n}}}(e.originalRequest))}async runEdgeFunction(e){throw Object.defineProperty(Error("Middleware is not supported in minimal mode. Please remove the `NEXT_MINIMAL` environment variable."),"__NEXT_ERROR_CODE",{value:"E58",enumerable:!1,configurable:!0})}get serverDistDir(){if(this._serverDistDir)return this._serverDistDir;let e=(0,v.join)(this.distDir,eV);return this._serverDistDir=e,e}async getFallbackErrorComponents(e){return null}async instrumentationOnRequestError(...e){await super.instrumentationOnRequestError(...e),this.logError(e[0])}onServerClose(e){this.cleanupListeners.add(e)}async close(){await this.cleanupListeners.runAll()}getInternalWaitUntil(){return this.internalWaitUntil??=this.createInternalWaitUntil(),this.internalWaitUntil}createInternalWaitUntil(){throw Object.defineProperty(new eh("createInternalWaitUntil should never be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E540",enumerable:!1,configurable:!0})}}})(),module.exports=n})();
|
13
|
+
See here for info: https://nextjs.org/docs/messages/custom-error-no-custom-404`)});let{dir:i=".",quiet:s=!1,conf:a,dev:o=!1,minimalMode:l=!1,hostname:d,port:u,experimentalTestProxy:c}=e;this.experimentalTestProxy=c,this.serverOptions=e,this.dir=v.resolve(i),this.quiet=s,this.loadEnvConfig({dev:o,forceReload:!1}),this.nextConfig=a,this.hostname=d,this.hostname&&(this.fetchHostname=function(e){return tk.test(e)?`[${e}]`:e}(this.hostname)),this.port=u,this.distDir=v.join(this.dir,this.nextConfig.distDir),this.publicDir=this.getPublicDir(),this.hasStaticDir=!l&&this.getHasStaticDir(),this.i18nProvider=(null==(t=this.nextConfig.i18n)?void 0:t.locales)?new nP(this.nextConfig.i18n):void 0,this.localeNormalizer=this.i18nProvider?new rQ(this.i18nProvider):void 0;let{serverRuntimeConfig:h={},publicRuntimeConfig:p,assetPrefix:f,generateEtags:m}=this.nextConfig;this.buildId=this.getBuildId(),this.minimalMode=l||!!process.env.NEXT_PRIVATE_MINIMAL_MODE,this.enabledDirectories=this.getEnabledDirectories(o),this.isAppPPREnabled=this.enabledDirectories.app&&function(e){return void 0!==e&&("boolean"==typeof e?e:"incremental"===e)}(this.nextConfig.experimental.ppr),this.isAppSegmentPrefetchEnabled=this.enabledDirectories.app&&!0===this.nextConfig.experimental.clientSegmentCache,this.normalizers={rsc:this.enabledDirectories.app&&1?new nI:void 0,prefetchRSC:this.isAppPPREnabled&&1?new nk:void 0,segmentPrefetchRSC:this.isAppSegmentPrefetchEnabled&&1?new nG:void 0,data:this.enabledDirectories.pages?new nj(this.buildId):void 0},this.nextFontManifest=this.getNextFontManifest(),process.env.NEXT_DEPLOYMENT_ID=this.nextConfig.deploymentId||"",this.renderOpts={dir:this.dir,supportsDynamicResponse:!0,trailingSlash:this.nextConfig.trailingSlash,deploymentId:this.nextConfig.deploymentId,poweredByHeader:this.nextConfig.poweredByHeader,canonicalBase:this.nextConfig.amp.canonicalBase||"",generateEtags:m,previewProps:this.getPrerenderManifest().preview,ampOptimizerConfig:null==(r=this.nextConfig.experimental.amp)?void 0:r.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(p).length>0?p:void 0,isExperimentalCompile:this.nextConfig.experimental.isExperimentalCompile,htmlLimitedBots:this.nextConfig.htmlLimitedBots,experimental:{expireTime:this.nextConfig.expireTime,staleTimes:this.nextConfig.experimental.staleTimes,clientTraceMetadata:this.nextConfig.experimental.clientTraceMetadata,cacheComponents:this.nextConfig.experimental.cacheComponents??!1,clientSegmentCache:"client-only"===this.nextConfig.experimental.clientSegmentCache?"client-only":!!this.nextConfig.experimental.clientSegmentCache,clientParamParsing:this.nextConfig.experimental.clientParamParsing??!1,clientParamParsingOrigins:this.nextConfig.experimental.clientParamParsingOrigins,dynamicOnHover:this.nextConfig.experimental.dynamicOnHover??!1,inlineCss:this.nextConfig.experimental.inlineCss??!1,authInterrupts:!!this.nextConfig.experimental.authInterrupts},onInstrumentationRequestError:this.instrumentationOnRequestError.bind(this),reactMaxHeadersLength:this.nextConfig.reactMaxHeadersLength},(0,tq.setConfig)({serverRuntimeConfig:h,publicRuntimeConfig:p}),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(f),this.responseCache=this.getResponseCache({dev:o})}reloadMatchers(){return this.matchers.reload()}getRouteMatchers(){let e=new nR(e=>{switch(e){case eF:return this.getPagesManifest()??null;case eH:return this.getAppPathsManifest()??null;default:return null}}),t=new r2;return t.push(new nC(this.distDir,e,this.i18nProvider)),t.push(new nx(this.distDir,e,this.i18nProvider)),this.enabledDirectories.app&&(t.push(new nh(this.distDir,e)),t.push(new nf(this.distDir,e))),t}async instrumentationOnRequestError(...e){let[t,r,n]=e;if(this.instrumentation)try{await (null==this.instrumentation.onRequestError?void 0:this.instrumentation.onRequestError.call(this.instrumentation,t,{path:r.url||"",method:r.method||"GET",headers:r instanceof nX?Object.fromEntries(r.headers.entries()):r.headers},n))}catch(e){console.error("Error in instrumentation.onRequestError:",e)}}logError(e){this.quiet||tb(e)}async handleRequest(e,t,r){await this.prepare();let n=e.method.toUpperCase(),i=(0,tt.getTracer)();return i.withPropagatedContext(e.headers,()=>i.trace(rh.handleRequest,{spanName:`${n}`,kind:tt.SpanKind.SERVER,attributes:{"http.method":n,"http.target":e.url}},async s=>this.handleRequestImpl(e,t,r).finally(()=>{if(!s)return;let r=eM(e,"isRSCRequest")??!1;s.setAttributes({"http.status_code":t.statusCode,"next.rsc":r}),t.statusCode&&t.statusCode>=500&&(s.setStatus({code:tt.SpanStatusCode.ERROR}),s.setAttribute("error.type",t.statusCode.toString()));let a=i.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==rh.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let o=a.get("next.route");if(o){let e=r?`RSC ${n} ${o}`:`${n} ${o}`;s.setAttributes({"next.route":o,"http.route":o,"next.span_name":e}),s.updateName(e)}else s.updateName(r?`RSC ${n}`:`${n}`)})))}async handleRequestImpl(e,t,r){try{await this.matchers.waitTillReady();var n,i,s,a,o,l,d,u,c,h=t.originalResponse;let p=h.setHeader.bind(h);h.setHeader=(t,r)=>{if("headersSent"in h&&h.headersSent)return h;if("set-cookie"===t.toLowerCase()){let t=eM(e,"middlewareCookie");t&&Array.isArray(r)&&r.every((e,r)=>e===t[r])||(r=[...new Set([...t||[],..."string"==typeof r?[r]:Array.isArray(r)?r:[]])])}return p(t,r)};let f=(e.url||"").split("?",1)[0];if(null==f?void 0:f.match(/(\\|\/\/)/)){let r=function(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?"?"+t.slice(1).join("?"):"")}(e.url);t.redirect(r,308).body(r).send();return}if(!r||"object"!=typeof r){if(!e.url)throw Object.defineProperty(Error("Invariant: url can not be undefined"),"__NEXT_ERROR_CODE",{value:"E123",enumerable:!1,configurable:!0});r=(0,b.parse)(e.url,!0)}if(!r.pathname)throw Object.defineProperty(Error("Invariant: pathname can't be empty"),"__NEXT_ERROR_CODE",{value:"E412",enumerable:!1,configurable:!0});"string"==typeof r.query&&(r.query=Object.fromEntries(new URLSearchParams(r.query)));let{originalRequest:m=null}=e,g=null==m?void 0:m.headers["x-forwarded-proto"],y=g?"https"===g:!!(null==m||null==(n=m.socket)?void 0:n.encrypted);e.headers["x-forwarded-host"]??=e.headers.host??this.hostname,e.headers["x-forwarded-port"]??=this.port?this.port.toString():y?"443":"80",e.headers["x-forwarded-proto"]??=y?"https":"http",e.headers["x-forwarded-for"]??=null==m||null==(i=m.socket)?void 0:i.remoteAddress,this.attachRequestMeta(e,r);let v=await this.handleRSCRequest(e,t,r);if(v)return;let _=null==(s=this.i18nProvider)?void 0:s.detectDomainLocale(t9(r,e.headers)),x=(null==_?void 0:_.defaultLocale)||(null==(a=this.nextConfig.i18n)?void 0:a.defaultLocale);eZ(e,"defaultLocale",x);let E=tf(e.url.replace(/^\/+/,"/")),w=t6(E.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});E.pathname=w.pathname,w.basePath&&(e.url=t5(e.url,this.nextConfig.basePath));let C="string"==typeof e.headers[e1];if(C)try{this.enabledDirectories.app&&(e.url.match(/^\/index($|\?)/)&&(e.url=e.url.replace(/^\/index/,"/")),r.pathname="/index"===r.pathname?"/":r.pathname);let{pathname:n}=new URL(function(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return new TextDecoder("utf-8").decode(t)}(e.headers[e1]),"http://localhost"),{pathname:i}=new URL(e.url,"http://localhost");if(null==(o=this.normalizers.data)?void 0:o.match(i))eZ(e,"isNextDataReq",!0);else if(this.isAppPPREnabled&&"1"===e.headers["next-resume"]&&"POST"===e.method){let t=[];for await(let r of e.body)t.push(r);let r=Buffer.concat(t).toString("utf8");eZ(e,"postponed",r)}n=this.normalize(n);let s=this.stripNextDataPath(i);n=rE(n);let a=null==(l=this.i18nProvider)?void 0:l.analyze(n,{defaultLocale:x});a&&(eZ(e,"locale",a.detectedLocale),a.inferredFromDefault?eZ(e,"localeInferredFromDefault",!0):eL(e,"localeInferredFromDefault"));let c=n,h=tL(c),p={params:!1,hasValidParams:!1};if(!h){let e=await this.matchers.match(c,{i18n:a});e&&(c=e.definition.pathname,void 0!==e.params&&(h=!0,p.params=e.params,p.hasValidParams=!0))}a&&(n=a.pathname);let f=function({page:e,i18n:t,basePath:r,rewrites:n,pageIsDynamic:i,trailingSlash:s,caseSensitive:a}){let o,l,d;return i&&(d=(l=eD(o=function(e,t){var r,n,i;let s=function(e,t,r,n,i){let s,a=(s=0,()=>{let e="",t=++s;for(;t>0;)e+=String.fromCharCode(97+(t-1)%26),t=Math.floor((t-1)/26);return e}),o={},l=[];for(let s of tQ(e).slice(1).split("/")){let e=tD.some(e=>s.startsWith(e)),d=s.match(rT);if(e&&d&&d[2])l.push(rI({getSafeRouteKey:a,interceptionMarker:d[1],segment:d[2],routeKeys:o,keyPrefix:t?e0:void 0,backreferenceDuplicateKeys:i}));else if(d&&d[2]){n&&d[1]&&l.push("/"+rP(d[1]));let e=rI({getSafeRouteKey:a,segment:d[2],routeKeys:o,keyPrefix:t?eQ:void 0,backreferenceDuplicateKeys:i});n&&d[1]&&(e=e.substring(1)),l.push(e)}else l.push("/"+rP(s));r&&d&&d[3]&&l.push(rP(d[3]))}return{namedParameterizedRoute:l.join(""),routeKeys:o}}(e,t.prefixRouteKeys,null!=(r=t.includeSuffix)&&r,null!=(n=t.includePrefix)&&n,null!=(i=t.backreferenceDuplicateKeys)&&i),a=s.namedParameterizedRoute;return t.excludeOptionalTrailingSlash||(a+="(?:/)?"),{...rS(e,t),namedRegex:"^"+a+"$",routeKeys:s.routeKeys}}(e,{prefixRouteKeys:!1})))(e)),{handleRewrites:function(o,d){let u={},c=d.pathname,h=n=>{let h=rw(n.source+(s?"(/)?":""),{removeUnnamedParams:!0,strict:!0,sensitive:!!a});if(!d.pathname)return!1;let p=h(d.pathname);if((n.has||n.missing)&&p){let e=rA(o,d.query,n.has,n.missing);e?Object.assign(p,e):p=!1}if(p){try{if(rB(n)){let e=o.headers[rz];e&&(p={...function e(t,r){for(let n of(void 0===r&&(r={}),Object.values(t[1]))){let t=n[0],i=Array.isArray(t),s=i?t[1]:t;!s||s.startsWith("__PAGE__")||(i&&("c"===t[2]||"oc"===t[2])?r[t[0]]=t[1].split("/"):i&&(r[t[0]]=t[1]),r=e(n,r))}return r}(function(e){if(void 0!==e){if(Array.isArray(e))throw Object.defineProperty(Error("Multiple router state headers were sent. This is not allowed."),"__NEXT_ERROR_CODE",{value:"E418",enumerable:!1,configurable:!0});if(e.length>4e4)throw Object.defineProperty(Error("The router state header was too large."),"__NEXT_ERROR_CODE",{value:"E142",enumerable:!1,configurable:!0});try{let t=JSON.parse(decodeURIComponent(e));return(0,r$.assert)(t,rq),t}catch{throw Object.defineProperty(Error("The router state header was sent but could not be parsed."),"__NEXT_ERROR_CODE",{value:"E10",enumerable:!1,configurable:!0})}}}(e)),...p})}}catch(e){}let{parsedDestination:s,destQuery:a}=function(e){let t,r,n=function(e){let t=e.destination;for(let n of Object.keys({...e.params,...e.query}))if(n){var r;r=t,t=r.replace(RegExp(":"+rP(n),"g"),"__ESC_COLON_"+n)}let n=tf(t),i=n.pathname;i&&(i=rk(i));let s=n.href;s&&(s=rk(s));let a=n.hostname;a&&(a=rk(a));let o=n.hash;o&&(o=rk(o));let l=n.search;l&&(l=rk(l));let d=n.origin;return d&&(d=rk(d)),{...n,pathname:i,hostname:a,href:s,hash:o,search:l,origin:d}}(e),{hostname:i,query:s,search:a}=n,o=n.pathname;n.hash&&(o=""+o+n.hash);let l=[],d=[];for(let e of(ej(o,d),d))l.push(e.name);if(i){let e=[];for(let t of(ej(i,e),e))l.push(t.name)}let u=eN(o,{validate:!1});for(let[r,n]of(i&&(t=eN(i,{validate:!1})),Object.entries(s)))Array.isArray(n)?s[r]=n.map(t=>rj(rk(t),e.params)):"string"==typeof n&&(s[r]=rj(rk(n),e.params));let c=Object.keys(e.params).filter(e=>"nextInternalLocale"!==e);if(e.appendParamsToQuery&&!c.some(e=>l.includes(e)))for(let t of c)t in s||(s[t]=e.params[t]);if(t$(o))for(let t of o.split("/")){let r=tD.find(e=>t.startsWith(e));if(r){"(..)(..)"===r?(e.params["0"]="(..)",e.params["1"]="(..)"):e.params["0"]=r;break}}try{let[i,s]=(r=u(e.params)).split("#",2);t&&(n.hostname=t(e.params)),n.pathname=i,n.hash=(s?"#":"")+(s||""),n.search=a?rj(a,e.params):""}catch(e){if(e.message.match(/Expected .*? to not repeat, but got an array/))throw Object.defineProperty(Error("To use a multi-match in the destination you must add `*` at the end of the param name to signify it should repeat. https://nextjs.org/docs/messages/invalid-multi-match"),"__NEXT_ERROR_CODE",{value:"E329",enumerable:!1,configurable:!0});throw e}return n.query={...e.query,...n.query},{newUrl:r,destQuery:s,parsedDestination:n}}({appendParamsToQuery:!0,destination:n.destination,params:p,query:d.query});if(s.protocol)return!0;if(Object.assign(u,a,p),Object.assign(d.query,s.query),delete s.query,Object.entries(d.query).forEach(([e,t])=>{if(t&&"string"==typeof t&&t.startsWith(":")){let r=u[t.slice(1)];r&&(d.query[e]=r)}}),Object.assign(d,s),!(c=d.pathname))return!1;if(r&&(c=c.replace(RegExp(`^${r}`),"")||"/"),t){let e=t8(c,t.locales);c=e.pathname,d.query.nextInternalLocale=e.detectedLocale||p.nextInternalLocale}if(c===e)return!0;if(i&&l){let e=l(c);if(e)return d.query={...d.query,...e},!0}}return!1};for(let e of n.beforeFiles||[])h(e);if(c!==e){let t=!1;for(let e of n.afterFiles||[])if(t=h(e))break;if(!t&&!(()=>{let t=tQ(c||"");return t===tQ(e)||(null==l?void 0:l(t))})()){for(let e of n.fallback||[])if(t=h(e))break}}return u},defaultRouteRegex:o,dynamicRouteMatcher:l,defaultRouteMatches:d,normalizeQueryParams:function(e,t){for(let[r,n]of(delete e.nextInternalLocale,Object.entries(e))){let i=tJ(r);i&&(delete e[r],t.add(i),void 0!==n&&(e[i]=Array.isArray(n)?n.map(e=>rN(e)):rN(n)))}},getParamsFromRouteMatches:function(e){if(!o)return null;let{groups:t,routeKeys:r}=o,n=eD({re:{exec:e=>{let n=Object.fromEntries(new URLSearchParams(e));for(let[e,t]of Object.entries(n)){let r=tJ(e);r&&(n[r]=t,delete n[e])}let i={};for(let e of Object.keys(r)){let s=r[e];if(!s)continue;let a=t[s],o=n[e];if(!a.optional&&!o)return null;i[a.pos]=o}return i}},groups:t})(e);return n||null},normalizeDynamicRouteParams:(e,t)=>{if(!o||!d)return{params:{},hasValidParams:!1};var r=o,n=d;let i={};for(let s of Object.keys(r.groups)){let a=e[s];"string"==typeof a?a=tN(a):Array.isArray(a)&&(a=a.map(tN));let o=n[s],l=r.groups[s].optional;if((Array.isArray(o)?o.some(e=>Array.isArray(a)?a.some(t=>t.includes(e)):null==a?void 0:a.includes(e)):null==a?void 0:a.includes(o))||void 0===a&&!(l&&t))return{params:{},hasValidParams:!1};l&&(!a||Array.isArray(a)&&1===a.length&&("index"===a[0]||a[0]===`[[...${s}]]`))&&(a=void 0,delete e[s]),a&&"string"==typeof a&&r.groups[s].repeat&&(a=a.split("/")),a&&(i[s]=a)}return{params:i,hasValidParams:!0}},normalizeCdnUrl:(e,t)=>(function(e,t){let r=function(e){let t=function(e){let t;try{t=new URL(e,"http://n")}catch{}return t}(e);if(!t)return;let r={};for(let e of t.searchParams.keys()){let n=t.searchParams.getAll(e);r[e]=n.length>1?n:n[0]}return{query:r,hash:t.hash,search:t.search,path:t.pathname,pathname:t.pathname,href:`${t.pathname}${t.search}${t.hash}`,host:"",hostname:"",auth:"",protocol:"",slashes:null,port:""}}(e.url);if(!r)return e.url;delete r.search,rG(r.query,t),e.url=function(e){let{auth:t,hostname:r}=e,n=e.protocol||"",i=e.pathname||"",s=e.hash||"",a=e.query||"",o=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?o=t+e.host:r&&(o=t+(~r.indexOf(":")?"["+r+"]":r),e.port&&(o+=":"+e.port)),a&&"object"==typeof a&&(a=String(function(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,tp(e));else t.set(r,tp(n));return t}(a)));let l=e.search||a&&"?"+a||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||rD.test(n))&&!1!==o?(o="//"+(o||""),i&&"/"!==i[0]&&(i="/"+i)):o||(o=""),s&&"#"!==s[0]&&(s="#"+s),l&&"?"!==l[0]&&(l="?"+l),i=i.replace(/[?#]/g,encodeURIComponent),""+n+o+i+(l=l.replace("#","%23"))+s}(r)})(e,t),interpolateDynamicPath:(e,t)=>(function(e,t,r){if(!r)return e;for(let n of Object.keys(r.groups)){let i,{optional:s,repeat:a}=r.groups[n],o=`[${a?"...":""}${n}]`;s&&(o=`[${o}]`);let l=t[n];((i=Array.isArray(l)?l.map(e=>e&&encodeURIComponent(e)).join("/"):l?encodeURIComponent(l):"")||s)&&(e=e.replaceAll(o,i))}return e})(e,t,o),filterInternalQuery:(e,t)=>rG(e,t)}}({pageIsDynamic:h,page:c,i18n:this.nextConfig.i18n,basePath:this.nextConfig.basePath,rewrites:(null==(d=this.getRoutesManifest())?void 0:d.rewrites)||{beforeFiles:[],afterFiles:[],fallback:[]},caseSensitive:!!this.nextConfig.experimental.caseSensitiveRoutes});x&&!w.locale&&(r.pathname=`/${x}${r.pathname}`);let m={...r.query},g=r.pathname,y=Object.keys(f.handleRewrites(e,r)),_={...r.query},b=g!==r.pathname;b&&r.pathname&&eZ(e,"rewroteURL",r.pathname);let C=new Set;for(let[e,t]of Object.entries(r.query)){let n=tJ(e);n&&(delete r.query[e],C.add(n),void 0!==t&&(_[n]=Array.isArray(t)?t.map(e=>rN(e)):rN(t)))}if(h){let t={};if(p.hasValidParams||(p=f.normalizeDynamicRouteParams(_,!1)),!p.hasValidParams&&!tL(s)){let e=null==f.dynamicRouteMatcher?void 0:f.dynamicRouteMatcher.call(f,s);e&&(f.normalizeDynamicRouteParams(e,!1),Object.assign(p.params,e),p.hasValidParams=!0)}if("/index"!==n&&!p.hasValidParams&&!tL(n)){let e=null==f.dynamicRouteMatcher?void 0:f.dynamicRouteMatcher.call(f,n);if(e){let r=f.normalizeDynamicRouteParams(e,!1);r.hasValidParams&&(Object.assign(t,e),p=r)}}p.hasValidParams&&(t=p.params);let r=e.headers["x-now-route-matches"];if("string"==typeof r&&r&&tL(n)&&!p.hasValidParams){let e=f.getParamsFromRouteMatches(r);e&&(p=f.normalizeDynamicRouteParams(e,!0)).hasValidParams&&(t=p.params)}if(!p.hasValidParams&&(p=f.normalizeDynamicRouteParams(_,!0)).hasValidParams&&(t=p.params),f.defaultRouteMatches&&s===c&&!p.hasValidParams&&(t=f.defaultRouteMatches,""===r&&eZ(e,"renderFallbackShell",!0)),t){n=f.interpolateDynamicPath(c,t),e.url=f.interpolateDynamicPath(e.url,t);let r=eM(e,"segmentPrefetchRSCRequest");r&&tL(r,!1)&&(r=f.interpolateDynamicPath(r,t),e.headers[rH]=r,eZ(e,"segmentPrefetchRSCRequest",r))}}for(let t of((h||b)&&f.normalizeCdnUrl(e,[...y,...Object.keys((null==(u=f.defaultRouteRegex)?void 0:u.groups)||{})]),C))t in m||delete r.query[t];if(r.pathname=n,E.pathname=r.pathname,v=await this.normalizeAndAttachMetadata(e,t,r))return}catch(r){if(r instanceof ew||r instanceof eC)return t.statusCode=400,this.renderError(null,e,t,"/_error",{});throw r}if(eZ(e,"isLocaleDomain",!!_),w.locale&&(e.url=(0,b.format)(E),eZ(e,"didStripLocale",!0)),!eM(e,"locale")&&(w.locale?eZ(e,"locale",w.locale):x&&(eZ(e,"locale",x),eZ(e,"localeInferredFromDefault",!0))),!this.serverOptions.webServerConfig&&!eM(e,"incrementalCache")){let t=await this.getIncrementalCache({requestHeaders:Object.assign({},e.headers)});t.resetRequestCache(),eZ(e,"incrementalCache",t),globalThis.__incrementalCache=t}let R=function(){if(nW[nV])return nW[nV].values()}();R&&await Promise.all([...R].map(async t=>{if("refreshTags"in t);else{let r=rK(e.headers,this.getPrerenderManifest().preview.previewModeId);await t.receiveExpiredTags(...r)}})),eM(e,"serverComponentsHmrCache")||eZ(e,"serverComponentsHmrCache",this.getServerComponentsHmrCache());let P=eM(e,"invokePath");if(!C&&P){let n=eM(e,"invokeStatus");if(n){let i=eM(e,"invokeQuery");i&&Object.assign(r.query,i),t.statusCode=n;let s=eM(e,"invokeError")||null;return this.renderError(s,e,t,"/_error",r.query)}let i=new URL(P||"/","http://n"),s=t6(i.pathname,{nextConfig:this.nextConfig,parseData:!1});s.locale&&eZ(e,"locale",s.locale),r.pathname!==i.pathname&&(r.pathname=i.pathname,eZ(e,"rewroteURL",s.pathname));let a=t8(t5(r.pathname,this.nextConfig.basePath||""),null==(c=this.nextConfig.i18n)?void 0:c.locales);for(let t of(a.detectedLocale&&eZ(e,"locale",a.detectedLocale),r.pathname=a.pathname,Object.keys(r.query)))delete r.query[t];let o=eM(e,"invokeQuery");if(o&&Object.assign(r.query,o),v=await this.normalizeAndAttachMetadata(e,t,r))return;await this.handleCatchallRenderRequest(e,t,r);return}if(eM(e,"middlewareInvoke")){if((v=await this.normalizeAndAttachMetadata(e,t,r))||(v=await this.handleCatchallMiddlewareRequest(e,t,r)))return;let n=Error();throw n.result={response:new Response(null,{headers:{"x-middleware-next":"1"}})},n.bubble=!0,n}return!C&&w.basePath&&(r.pathname=t5(r.pathname,w.basePath)),t.statusCode=200,await this.run(e,t,r)}catch(r){if(r instanceof nK.NoFallbackError)throw r;if(r&&"object"==typeof r&&"ERR_INVALID_URL"===r.code||r instanceof ew||r instanceof eC)return t.statusCode=400,this.renderError(null,e,t,"/_error",{});throw r}}getRequestHandlerWithMetadata(e){let t=this.getRequestHandler();return(r,n,i)=>(r[e$]=e,t(r,n,i))}getRequestHandler(){return this.handleRequest.bind(this)}setAssetPrefix(e){this.nextConfig.assetPrefix=e?e.replace(/\/$/,""):""}async prepare(){if(!this.prepared)return this.instrumentation||(this.instrumentation=await this.loadInstrumentationModule()),null===this.preparedPromise&&(this.preparedPromise=this.prepareImpl().then(()=>{this.prepared=!0,this.preparedPromise=null})),this.preparedPromise}async prepareImpl(){}async loadInstrumentationModule(){}async close(){}getAppPathRoutes(){let e={};return Object.keys(this.appPathsManifest||{}).forEach(t=>{let r=tj(t);e[r]||(e[r]=[]),e[r].push(t)}),e}async run(e,t,r){return(0,tt.getTracer)().trace(rh.run,async()=>this.runImpl(e,t,r))}async runImpl(e,t,r){await this.handleCatchallRenderRequest(e,t,r)}async pipe(e,t){return(0,tt.getTracer)().trace(rh.pipe,async()=>this.pipeImpl(e,t))}async pipeImpl(e,t){let r=t.req.headers["user-agent"]||"",n={...t,renderOpts:{...this.renderOpts,supportsDynamicResponse:!this.renderOpts.botType,serveStreamingMetadata:function(e,t){let r=RegExp(t||tF,"i");return!(e&&r.test(e))}(r,this.nextConfig.htmlLimitedBots)}},i=await e(n);if(null===i)return;let{req:s,res:a}=n,o=a.statusCode,{body:l}=i,{cacheControl:d}=i;if(!a.sent){let{generateEtags:e,poweredByHeader:t,dev:r}=this.renderOpts;r&&(a.setHeader("Cache-Control","no-store, must-revalidate"),d=void 0),d&&void 0===d.expire&&(d.expire=this.nextConfig.expireTime),await this.sendRenderResult(s,a,{result:l,generateEtags:e,poweredByHeader:t,cacheControl:d}),a.statusCode=o}}async getStaticHTML(e,t){let r={...t,renderOpts:{...this.renderOpts,supportsDynamicResponse:!1}},n=await e(r);return null===n?null:n.body.toUnchunkedString()}async render(e,t,r,n={},i,s=!1){return(0,tt.getTracer)().trace(rh.render,async()=>this.renderImpl(e,t,r,n,i,s))}getWaitUntil(){let e=function(){let e=globalThis[nD];return null==e?void 0:e.get()}();if(e)return e.waitUntil}getInternalWaitUntil(){}async renderImpl(e,t,r,n={},i,s=!1){var a;r.startsWith("/")||console.warn(`Cannot render page with path "${r}", did you mean "/${r}"?. See more info here: https://nextjs.org/docs/messages/render-no-starting-slash`),this.serverOptions.customServer&&"/index"===r&&!await this.hasPage("/index")&&(r="/");let o=e.headers["user-agent"]||"";return this.renderOpts.botType=function(e){return tz.test(e)?"dom":tU.test(e)?"html":void 0}(o),(a=r,eW.includes(a))?this.render404(e,t,i):this.pipe(e=>this.renderToResponse(e),{req:e,res:t,pathname:r,query:n})}async getStaticPaths({pathname:e}){var t;return{staticPaths:void 0,fallbackMode:function(e){if("string"==typeof e)return"PRERENDER";if(null===e)return"BLOCKING_STATIC_RENDER";if(!1===e)return"NOT_FOUND";if(void 0!==e)throw Object.defineProperty(Error(`Invalid fallback option: ${e}. Fallback option must be a string, null, undefined, or false.`),"__NEXT_ERROR_CODE",{value:"E285",enumerable:!1,configurable:!0})}(null==(t=this.getPrerenderManifest().dynamicRoutes[e])?void 0:t.fallback)}}async renderToResponseWithComponents(e,t){return(0,tt.getTracer)().trace(rh.renderToResponseWithComponents,async()=>this.renderToResponseWithComponentsImpl(e,t))}pathCouldBeIntercepted(e){return t$(e)||this.interceptionRoutePatterns.some(t=>t.test(e))}setVaryHeader(e,t,r,n){let i=`rsc, ${rz}, ${rF}, ${rH}`,s=eM(e,"isRSCRequest")??!1,a=!1;r&&this.pathCouldBeIntercepted(n)?(t.appendHeader("vary",`${i}, ${rV}`),a=!0):(r||s)&&t.appendHeader("vary",i),a||delete e.headers[rV]}async renderToResponseWithComponentsImpl({req:e,res:t,pathname:r,renderOpts:n},{components:i,query:s}){var a,o,l,d,u,c;let h,p;r===eq&&(r="/404");let f="/_error"===r,m="/404"===r||f&&404===t.statusCode,g="/500"===r||f&&500===t.statusCode,y=!0===i.isAppPath,v=!!i.getServerSideProps,_=function(e){let t,r;e.headers instanceof Headers?(t=e.headers.get(rU)??null,r=e.headers.get("content-type")):(t=e.headers[rU]??null,r=e.headers["content-type"]??null);let n="POST"===e.method&&"application/x-www-form-urlencoded"===r,i=!!("POST"===e.method&&(null==r?void 0:r.startsWith("multipart/form-data"))),s=void 0!==t&&"string"==typeof t&&"POST"===e.method;return{actionId:t,isURLEncodedAction:n,isMultipartAction:i,isFetchAction:s,isPossibleServerAction:!!(s||n||i)}}(e).isPossibleServerAction,x=!!i.getStaticProps,E=eM(e,"isRSCRequest")??!1,w=(0,b.parse)(e.url||"").pathname||"/",C=eM(e,"rewroteURL")||w;this.setVaryHeader(e,t,y,C);let R=this.getPrerenderManifest();(null==h?void 0:h.includes(C))||e.headers["x-now-route-matches"]?x=!0:x||=!!R.routes[nN(r)];let P=!!(eM(e,"isNextDataReq")||e.headers["x-nextjs-data"]&&this.serverOptions.webServerConfig)&&(x||v);if(!x&&e.headers["x-middleware-prefetch"]&&!(m||"/_error"===r))return t.setHeader(e1,r),t.setHeader("x-middleware-skip","1"),t.setHeader("cache-control","private, no-cache, no-store, max-age=0, must-revalidate"),t.body("{}").send(),null;x&&e.headers[e1]&&e.url.startsWith("/_next/data")&&(e.url=this.stripNextDataPath(e.url));let T=eM(e,"locale");e.headers["x-nextjs-data"]&&(!t.statusCode||200===t.statusCode)&&t.setHeader("x-nextjs-matched-path",`${T?`/${T}`:""}${r}`),i.routeModule&&(p=i.routeModule);let O=this.isAppPPREnabled&&void 0!==p&&p.definition.kind===nl.APP_PAGE,S="1"===process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING&&void 0!==s.__nextppronly&&O,I=O&&((null==(a=R.routes[r]??R.dynamicRoutes[r])?void 0:a.renderingMode)==="PARTIALLY_STATIC"||S&&!0===this.experimentalTestProxy)?eM(e,"postponed"):void 0;if(!m||P||E||(t.statusCode=404),eX.includes(r)&&(t.statusCode=parseInt(r.slice(1),10)),!_&&!I&&!m&&!g&&"/_error"!==r&&"HEAD"!==e.method&&"GET"!==e.method&&("string"==typeof i.Component||x))return t.statusCode=405,t.setHeader("Allow",["GET","HEAD"]),t.body("Method Not Allowed").send(),null;if("string"==typeof i.Component)return{body:rb.fromStatic(i.Component,eJ)};if("amp"in s&&!s.amp&&delete s.amp,!0===n.supportsDynamicResponse){let t=(u=d=e.headers["user-agent"]||"",tz.test(u)||tU.test(d)),r="function"!=typeof(null==(o=i.Document)?void 0:o.getInitialProps)||"__NEXT_BUILTIN_DOCUMENT__"in i.Document;n.supportsDynamicResponse=!x&&!t&&!s.amp&&r}if(!P&&y&&n.dev&&(n.supportsDynamicResponse=!0),x&&e.headers[e1]&&(C=w),w=tQ(w),C=tQ(C),this.localeNormalizer&&(C=this.localeNormalizer.normalize(C)),P&&(C=this.stripNextDataPath(C),w=this.stripNextDataPath(w)),(await this.getIncrementalCache({requestHeaders:Object.assign({},e.headers)})).resetRequestCache(),(null==p?void 0:p.isDev)&&tL(r)&&(i.getStaticPaths||y)){let t=await this.getStaticPaths({pathname:r,urlPathname:w,requestHeaders:e.headers,page:i.page,isAppPath:y});if(y&&this.nextConfig.experimental.cacheComponents&&(null==(l=t.prerenderedRoutes)?void 0:l.length)){let r=null;for(let e of t.prerenderedRoutes){let t=e.fallbackRouteParams;if(!t||0===t.length){r=null;break}(null===r||t.length<r.length)&&(r=t)}r&&eZ(e,"devValidatingFallbackParams",function(e){if(0===e.length)return null;let t=Math.random().toString(16).slice(2),r=new Map;for(let{paramName:n,paramType:i}of e)r.set(n,[`%%drp:${n}:${t}%%`,nJ[i]]);return r}(r))}}if("OPTIONS"===e.method&&!m&&(!p||p.definition.kind!==nl.APP_ROUTE))return await nT(e,t,new Response(null,{status:400})),null;let k=e.originalRequest,A=t.originalResponse,j=(0,b.parse)(eM(e,"initURL")||e.url),N=j.pathname||"/";for(let e of[this.normalizers.segmentPrefetchRSC,this.normalizers.prefetchRSC,this.normalizers.rsc])(null==e?void 0:e.match(N))&&(N=e.normalize(N));f||(k.url=`${N}${j.search||""}`),c=eM(e),k[e$]=c,eZ(k,"distDir",this.distDir),eZ(k,"query",s),eZ(k,"params",n.params),eZ(k,"ampValidator",this.renderOpts.ampValidator),eZ(k,"minimalMode",!0),n.err&&eZ(k,"invokeError",n.err);let D=i.ComponentMod.handler;return await D(k,A,{waitUntil:this.getWaitUntil()}),null}stripNextDataPath(e,t=!0){return(e.includes(this.buildId)&&(e=rE(e.substring(e.indexOf(this.buildId)+this.buildId.length).replace(/\.json$/,""))),this.localeNormalizer&&t)?this.localeNormalizer.normalize(e):e}getOriginalAppPaths(e){if(this.enabledDirectories.app){var t;let r=null==(t=this.appPathRoutes)?void 0:t[e];return r||null}return null}async renderPageComponent(e,t){var r;let{query:n,pathname:i}=e,s=this.getOriginalAppPaths(i),a=Array.isArray(s),o=i;a&&(o=s[s.length-1]);let l=await this.findPageComponents({locale:eM(e.req,"locale"),page:o,query:n,params:e.renderOpts.params||{},isAppPath:a,sriEnabled:!!(null==(r=this.nextConfig.experimental.sri)?void 0:r.algorithm),appPaths:s,shouldEnsure:!1});if(l){(0,tt.getTracer)().setRootSpanAttribute("next.route",i);try{return await this.renderToResponseWithComponents(e,l)}catch(r){let e=r instanceof nK.NoFallbackError;if(!e||e&&t)throw r}}return!1}async renderToResponse(e){return(0,tt.getTracer)().trace(rh.renderToResponse,{spanName:"rendering page",attributes:{"next.route":e.pathname}},async()=>this.renderToResponseImpl(e))}async renderToResponseImpl(e){var t;let{req:r,res:n,query:i,pathname:s}=e,a=eM(e.req,"bubbleNoFallback")??!1;delete i[rX];let o={i18n:null==(t=this.i18nProvider)?void 0:t.fromRequest(r,s)};try{for await(let t of this.matchers.matchAll(s,o)){eM(e.req,"invokeOutput");let r=await this.renderPageComponent({...e,pathname:t.definition.pathname,renderOpts:{...e.renderOpts,params:t.params}},a);if(!1!==r)return r}if(this.serverOptions.webServerConfig){e.pathname=this.serverOptions.webServerConfig.page;let t=await this.renderPageComponent(e,a);if(!1!==t)return t}}catch(i){let t=rJ(i);if(i instanceof eP)throw console.error("Invariant: failed to load static page",JSON.stringify({page:s,url:e.req.url,matchedPath:e.req.headers[e1],initUrl:eM(e.req,"initURL"),didRewrite:!!eM(e.req,"rewroteURL"),rewroteUrl:eM(e.req,"rewroteURL")},null,2)),t;if(t instanceof nK.NoFallbackError&&a)throw t;if(t instanceof ew||t instanceof eC)return n.statusCode=400,await this.renderErrorToResponse(e,t);n.statusCode=500,await this.hasPage("/500")&&(eZ(e.req,"customErrorRender",!0),await this.renderErrorToResponse(e,t),eL(e.req,"customErrorRender"));let r=t instanceof nQ;if(!r)throw rY(t)&&(t.page=s),t;return await this.renderErrorToResponse(e,r?t.innerError:t)}if(await this.getMiddleware()&&e.req.headers["x-nextjs-data"]&&(!n.statusCode||200===n.statusCode||404===n.statusCode)){let e=eM(r,"locale");return n.setHeader("x-nextjs-matched-path",`${e?`/${e}`:""}${s}`),n.statusCode=200,n.setHeader("Content-Type","application/json; charset=utf-8"),n.body("{}"),n.send(),null}return n.statusCode=404,this.renderErrorToResponse(e,null)}async renderToHTML(e,t,r,n={}){return(0,tt.getTracer)().trace(rh.renderToHTML,async()=>this.renderToHTMLImpl(e,t,r,n))}async renderToHTMLImpl(e,t,r,n={}){return this.getStaticHTML(e=>this.renderToResponse(e),{req:e,res:t,pathname:r,query:n})}async renderError(e,t,r,n,i={},s=!0){return(0,tt.getTracer)().trace(rh.renderError,async()=>this.renderErrorImpl(e,t,r,n,i,s))}async renderErrorImpl(e,t,r,n,i={},s=!0){return s&&r.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),this.pipe(async t=>{let n=await this.renderErrorToResponse(t,e);if(500===r.statusCode)throw e;return n},{req:t,res:r,pathname:n,query:i})}async renderErrorToResponse(e,t){return(0,tt.getTracer)().trace(rh.renderErrorToResponse,async()=>this.renderErrorToResponseImpl(e,t))}async renderErrorToResponseImpl(e,t){let{res:r,query:n}=e;try{let i=null,s=404===r.statusCode,a=this.enabledDirectories.app;s&&(a&&(i=await this.findPageComponents({locale:eM(e.req,"locale"),page:eU,query:n,params:{},isAppPath:!0,shouldEnsure:!0,url:e.req.url})),!i&&await this.hasPage("/404")&&(i=await this.findPageComponents({locale:eM(e.req,"locale"),page:"/404",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url})));let o=`/${r.statusCode}`;if(!eM(e.req,"customErrorRender")&&!i&&eX.includes(o)&&(!i&&a&&(i=await this.findPageComponents({locale:eM(e.req,"locale"),page:o,query:n,params:{},isAppPath:!0,shouldEnsure:!0,url:e.req.url})),i=await this.findPageComponents({locale:eM(e.req,"locale"),page:o,query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url})),i||(i=await this.findPageComponents({locale:eM(e.req,"locale"),page:"/_error",query:n,params:{},isAppPath:!1,shouldEnsure:!0,url:e.req.url}),o="/_error"),!i)throw new nQ(Object.defineProperty(Error("missing required error components"),"__NEXT_ERROR_CODE",{value:"E60",enumerable:!1,configurable:!0}));i.components.routeModule?eZ(e.req,"match",{definition:i.components.routeModule.definition,params:void 0}):eL(e.req,"match");try{return await this.renderToResponseWithComponents({...e,pathname:o,renderOpts:{...e.renderOpts,err:t}},i)}catch(e){if(e instanceof nK.NoFallbackError)throw Object.defineProperty(Error("invariant: failed to render error page"),"__NEXT_ERROR_CODE",{value:"E55",enumerable:!1,configurable:!0});throw e}}catch(a){let t=rJ(a),i=t instanceof nQ;i||this.logError(t),r.statusCode=500;let s=await this.getFallbackErrorComponents(e.req.url);if(s)return eZ(e.req,"match",{definition:s.routeModule.definition,params:void 0}),this.renderToResponseWithComponents({...e,pathname:"/_error",renderOpts:{...e.renderOpts,err:i?t.innerError:t}},{query:n,components:s});return{body:rb.fromStatic("Internal Server Error","text/plain")}}}async renderErrorToHTML(e,t,r,n,i={}){return this.getStaticHTML(t=>this.renderErrorToResponse(t,e),{req:t,res:r,pathname:n,query:i})}async render404(e,t,r,n=!0){let{pathname:i,query:s}=r||(0,b.parse)(e.url,!0);return this.nextConfig.i18n&&(eM(e,"locale")||eZ(e,"locale",this.nextConfig.i18n.defaultLocale),eZ(e,"defaultLocale",this.nextConfig.i18n.defaultLocale)),t.statusCode=404,this.renderError(null,e,t,i,s,n)}}let n1=require("next/dist/server/load-manifest.external.js"),n4=new C(1e3);function n2(e,t,r,n){let i,s=`${e}:${t}:${r}:${n}`,a=null==n4?void 0:n4.get(s);if(a)return a;let o=_().join(t,eV);n&&(i=(0,n1.loadManifest)(_().join(o,eH),!0));let l=(0,n1.loadManifest)(_().join(o,eF),!0);try{e=rE(r6(e))}catch(t){throw console.error(t),new eR(e)}let d=t=>{let n=t[e];if(!t[n]&&r){let i={};for(let e of Object.keys(t))i[t8(e,r).pathname]=l[e];n=i[e]}return n};return(i&&(a=d(i)),a||(a=d(l)),a)?(_().isAbsolute(a)||(a=_().join(o,a)),null==n4||n4.set(s,a),a):(null==n4||n4.set(s,null),null)}function n9(e,t,r,n){let i=n2(e,t,r,n);if(!i)throw new eR(e);return i}async function n3(e,t,r){let n=n9(e,t,void 0,r);return n.endsWith(".html")?eT.promises.readFile(n,"utf8").catch(t=>{throw new eP(e,t.message)}):require(n)}function n8(e){return e.default||e}async function n5(e){return new Promise(t=>setTimeout(t,e))}let n6=Symbol.for("next.server.action-manifests");async function n7(e,t=3){for(;;)try{return(0,n1.loadManifest)(e)}catch(e){if(--t<=0)throw e;await n5(100)}}async function ie(e,t=3){try{return await n7(e,t)}catch(e){return}}async function it(e,t=3){for(;;)try{return(0,n1.evalManifest)(e)}catch(e){if(--t<=0)throw e;await n5(100)}}async function ir(e,t,r){try{return(await it(e,r)).__RSC_MANIFEST[t]}catch(e){return}}async function ii({distDir:e,page:t,isAppPath:r,isDev:n,sriEnabled:i,needsManifestsForLegacyReasons:s}){let a={},o={};if(r||([a,o]=await Promise.all([n3("/_document",e,!1),n3("/_app",e,!1)])),s){let s,l=n?3:1;s=(0,v.join)(e,"react-loadable-manifest.json");let d=!function(e){let t=e.replace(/\/route$/,"");return nr(e)&&function(e,t,r){let n=(r?"":"?")+"$",i=`\\d?${r?"":"(-\\w{6})?"}`,s=[RegExp(`^[\\\\/]robots${ni(t.concat("txt"),null)}${n}`),RegExp(`^[\\\\/]manifest${ni(t.concat("webmanifest","json"),null)}${n}`),RegExp("^[\\\\/]favicon\\.ico$"),RegExp(`[\\\\/]sitemap${ni(["xml"],t)}${n}`),RegExp(`[\\\\/]${nn.icon.filename}${i}${ni(nn.icon.extensions,t)}${n}`),RegExp(`[\\\\/]${nn.apple.filename}${i}${ni(nn.apple.extensions,t)}${n}`),RegExp(`[\\\\/]${nn.openGraph.filename}${i}${ni(nn.openGraph.extensions,t)}${n}`),RegExp(`[\\\\/]${nn.twitter.filename}${i}${ni(nn.twitter.extensions,t)}${n}`)],a=rx(e);return s.some(e=>e.test(a))}(t,[],!0)&&"/robots.txt"!==t&&"/manifest.webmanifest"!==t&&!t.endsWith("/sitemap.xml")}(t),[u,c,h,p,f,m]=await Promise.all([n7((0,v.join)(e,"build-manifest.json"),l),ie(s,l),r||0?void 0:n7((0,v.join)(e,"dynamic-css-manifest.json"),l).catch(()=>void 0),r&&d?ir((0,v.join)(e,"server","app",t.replace(/%5F/g,"_")+"_client-reference-manifest.js"),t.replace(/%5F/g,"_"),l):void 0,r?n7((0,v.join)(e,"server","server-reference-manifest.json"),l).catch(()=>null):null,i?n7((0,v.join)(e,"server","subresource-integrity-manifest.json")).catch(()=>void 0):void 0]);f&&p&&function({page:e,clientReferenceManifest:t,serverActionsManifest:r,serverModuleMap:n}){var i;let s=null==(i=globalThis[n6])?void 0:i.clientReferenceManifestsPerPage;globalThis[n6]={clientReferenceManifestsPerPage:{...s,[tj(e)]:t},serverActionsManifest:r,serverModuleMap:n}}({page:t,clientReferenceManifest:p,serverActionsManifest:f,serverModuleMap:function({serverActionsManifest:e}){return new Proxy({},{get:(t,r)=>{var n,i,s;let a,o=null==(i=e.node)||null==(n=i[r])?void 0:n.workers;if(!o)return;let l=eu.workAsyncStorage.getStore();if(!(a=l?o[t2(s=l.page,"app")?s:"app"+s]:Object.values(o).at(0)))return;let{moduleId:d,async:u}=a;return{id:d,name:r,chunks:[],async:u}}})}({serverActionsManifest:f})});let g=await n3(t,e,r),y=n8(g),_=n8(a),b=n8(o),{getServerSideProps:x,getStaticProps:E,getStaticPaths:w,routeModule:C}=g;return{App:b,Document:_,Component:y,buildManifest:u,subresourceIntegrityManifest:m,reactLoadableManifest:c||{},dynamicCssManifest:h,pageConfig:g.config||{},ComponentMod:g,getServerSideProps:x,getStaticProps:E,getStaticPaths:w,clientReferenceManifest:p,serverActionsManifest:f,isAppPath:r,page:t,routeModule:C}}{let n=await n3(t,e,r),i=n8(n),s=n8(a),l=n8(o),{getServerSideProps:d,getStaticProps:u,getStaticPaths:c,routeModule:h}=n;return{App:l,Document:s,Component:i,pageConfig:n.config||{},ComponentMod:n,getServerSideProps:d,getStaticProps:u,getStaticPaths:c,isAppPath:r,page:t,routeModule:h}}}let is=(0,tt.getTracer)().wrap(rp.loadComponents,ii);function ia(e){return(t,r,n)=>{for(let i of e)if(new RegExp(i.regexp).exec(t)){if((i.has||i.missing)&&!rA(r,n,i.has,i.missing))continue;return!0}return!1}}var io=r("../next-env/dist/index.js");let il=require("stream");var id=r.n(il);class iu{constructor(e,t=e=>e()){this.cacheKeyFn=e,this.schedulerFn=t,this.pending=new Map}static create(e){return new iu(null==e?void 0:e.cacheKeyFn,null==e?void 0:e.schedulerFn)}async batch(e,t){let r=this.cacheKeyFn?await this.cacheKeyFn(e):e;if(null===r)return t({resolve:e=>Promise.resolve(e),key:e});let n=this.pending.get(r);if(n)return n;let{promise:i,resolve:s,reject:a}=new rc;return this.pending.set(r,i),this.schedulerFn(async()=>{try{let r=await t({resolve:s,key:e});s(r)}catch(e){a(e)}finally{this.pending.delete(r)}}),i}}let ic=e=>{Promise.resolve().then(()=>{process.nextTick(e)})};var ih=function(e){return e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.PAGES="PAGES",e.FETCH="FETCH",e.REDIRECT="REDIRECT",e.IMAGE="IMAGE",e}({}),ip=function(e){return e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.PAGES="PAGES",e.FETCH="FETCH",e.IMAGE="IMAGE",e}({});async function im(e){var t,r;return{...e,value:(null==(t=e.value)?void 0:t.kind)===ih.PAGES?{kind:ih.PAGES,html:await e.value.html.toUnchunkedString(!0),pageData:e.value.pageData,headers:e.value.headers,status:e.value.status}:(null==(r=e.value)?void 0:r.kind)===ih.APP_PAGE?{kind:ih.APP_PAGE,html:await e.value.html.toUnchunkedString(!0),postponed:e.value.postponed,rscData:e.value.rscData,headers:e.value.headers,status:e.value.status,segmentData:e.value.segmentData}:e.value}}async function ig(e){var t,r;return e?{isMiss:e.isMiss,isStale:e.isStale,cacheControl:e.cacheControl,value:(null==(t=e.value)?void 0:t.kind)===ih.PAGES?{kind:ih.PAGES,html:rb.fromStatic(e.value.html,eJ),pageData:e.value.pageData,headers:e.value.headers,status:e.value.status}:(null==(r=e.value)?void 0:r.kind)===ih.APP_PAGE?{kind:ih.APP_PAGE,html:rb.fromStatic(e.value.html,eJ),rscData:e.value.rscData,headers:e.value.headers,status:e.value.status,postponed:e.value.postponed,segmentData:e.value.segmentData}:e.value}:null}class iy{constructor(e){this.getBatcher=iu.create({cacheKeyFn:({key:e,isOnDemandRevalidate:t})=>`${e}-${t?"1":"0"}`,schedulerFn:ic}),this.revalidateBatcher=iu.create({schedulerFn:ic}),this.minimal_mode=e}async get(e,t,r){var n;if(!e)return t({hasResolved:!1,previousCacheEntry:null});if(this.minimal_mode&&(null==(n=this.previousCacheItem)?void 0:n.key)===e&&this.previousCacheItem.expiresAt>Date.now())return ig(this.previousCacheItem.entry);let{incrementalCache:i,isOnDemandRevalidate:s=!1,isFallback:a=!1,isRoutePPREnabled:o=!1,isPrefetch:l=!1,waitUntil:d,routeKind:u}=r;return ig(await this.getBatcher.batch({key:e,isOnDemandRevalidate:s},({resolve:r})=>{let n=this.handleGet(e,t,{incrementalCache:i,isOnDemandRevalidate:s,isFallback:a,isRoutePPREnabled:o,isPrefetch:l,routeKind:u},r);return d&&d(n),n}))}async handleGet(e,t,r,n){let i=null,s=!1;try{if((i=this.minimal_mode?null:await r.incrementalCache.get(e,{kind:function(e){switch(e){case nl.PAGES:return ip.PAGES;case nl.APP_PAGE:return ip.APP_PAGE;case nl.IMAGE:return ip.IMAGE;case nl.APP_ROUTE:return ip.APP_ROUTE;case nl.PAGES_API:throw Object.defineProperty(Error(`Unexpected route kind ${e}`),"__NEXT_ERROR_CODE",{value:"E64",enumerable:!1,configurable:!0});default:return e}}(r.routeKind),isRoutePPREnabled:r.isRoutePPREnabled,isFallback:r.isFallback}))&&!r.isOnDemandRevalidate&&(n(i),s=!0,!i.isStale||r.isPrefetch))return i;let a=await this.revalidate(e,r.incrementalCache,r.isRoutePPREnabled,r.isFallback,t,i,null!==i&&!r.isOnDemandRevalidate);if(!a)return this.minimal_mode&&(this.previousCacheItem=void 0),null;return r.isOnDemandRevalidate,a}catch(e){if(s)return console.error(e),null;throw e}}async revalidate(e,t,r,n,i,s,a,o){return this.revalidateBatcher.batch(e,()=>{let l=this.handleRevalidate(e,t,r,n,i,s,a);return o&&o(l),l})}async handleRevalidate(e,t,r,n,i,s,a){try{let o=await i({hasResolved:a,previousCacheEntry:s,isRevalidating:!0});if(!o)return null;let l=await im({...o,isMiss:!s});return l.cacheControl&&(this.minimal_mode?this.previousCacheItem={key:e,entry:l,expiresAt:Date.now()+1e3}:await t.set(e,l.value,{cacheControl:l.cacheControl,isRoutePPREnabled:r,isFallback:n})),l}catch(i){if(null==s?void 0:s.cacheControl){let i=Math.min(Math.max(s.cacheControl.revalidate||3,3),30),a=void 0===s.cacheControl.expire?void 0:Math.max(i+3,s.cacheControl.expire);await t.set(e,s.value,{cacheControl:{revalidate:i,expire:a},isRoutePPREnabled:r,isFallback:n})}throw i}}}let iv=require("next/dist/server/lib/incremental-cache/tags-manifest.external.js");class i_{constructor(e){this.fs=e,this.tasks=[]}findOrCreateTask(e){for(let t of this.tasks)if(t[0]===e)return t;let t=this.fs.mkdir(e);t.catch(()=>{});let r=[e,t,[]];return this.tasks.push(r),r}append(e,t){let r=this.findOrCreateTask(r8().dirname(e)),n=r[1].then(()=>this.fs.writeFile(e,t));n.catch(()=>{}),r[2].push(n)}wait(){return Promise.all(this.tasks.flatMap(e=>e[2]))}}let ib=require("next/dist/server/lib/incremental-cache/memory-cache.external.js");class ix{static #e=this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;constructor(e){this.fs=e.fs,this.flushToDisk=e.flushToDisk,this.serverDistDir=e.serverDistDir,this.revalidatedTags=e.revalidatedTags,e.maxMemoryCacheSize?ix.memoryCache?ix.debug&&console.log("FileSystemCache: memory store already initialized"):(ix.debug&&console.log("FileSystemCache: using memory store for fetch cache"),ix.memoryCache=(0,ib.getMemoryCache)(e.maxMemoryCacheSize)):ix.debug&&console.log("FileSystemCache: not using memory store for fetch cache")}resetRequestCache(){}async revalidateTag(...e){let[t]=e;if(t="string"==typeof t?[t]:t,ix.debug&&console.log("FileSystemCache: revalidateTag",t),0!==t.length)for(let e of t)iv.tagsManifest.has(e)||iv.tagsManifest.set(e,Date.now())}async get(...e){var t,r,n,i,s,a,o,l,d;let[u,c]=e,{kind:h}=c,p=null==(t=ix.memoryCache)?void 0:t.get(u);if(ix.debug&&(h===ip.FETCH?console.log("FileSystemCache: get",u,c.tags,h,!!p):console.log("FileSystemCache: get",u,h,!!p)),!p)try{if(h===ip.APP_ROUTE){let e=this.getFilePath(`${u}.body`,ip.APP_ROUTE),t=await this.fs.readFile(e),{mtime:r}=await this.fs.stat(e),n=JSON.parse(await this.fs.readFile(e.replace(/\.body$/,e5),"utf8"));p={lastModified:r.getTime(),value:{kind:ih.APP_ROUTE,body:t,headers:n.headers,status:n.status}}}else{let e=this.getFilePath(h===ip.FETCH?u:`${u}.html`,h),t=await this.fs.readFile(e,"utf8"),{mtime:r}=await this.fs.stat(e);if(h===ip.FETCH){let{tags:e,fetchIdx:n,fetchUrl:i}=c;if(!this.flushToDisk)return null;let s=r.getTime(),l=JSON.parse(t);if(p={lastModified:s,value:l},(null==(a=p.value)?void 0:a.kind)===ih.FETCH){let t=null==(o=p.value)?void 0:o.tags;(null==e?void 0:e.every(e=>null==t?void 0:t.includes(e)))||(ix.debug&&console.log("FileSystemCache: tags vs storedTags mismatch",e,t),await this.set(u,p.value,{fetchCache:!0,tags:e,fetchIdx:n,fetchUrl:i}))}}else if(h===ip.APP_PAGE){let n,i,s;try{n=JSON.parse(await this.fs.readFile(e.replace(/\.html$/,e5),"utf8"))}catch{}if(null==n?void 0:n.segmentPaths){let e=new Map;i=e;let t=u+e2;await Promise.all(n.segmentPaths.map(async r=>{let n=this.getFilePath(t+r+e9,ip.APP_PAGE);try{e.set(r,await this.fs.readFile(n))}catch{}}))}c.isFallback||(s=await this.fs.readFile(this.getFilePath(`${u}${c.isRoutePPREnabled?e4:e3}`,ip.APP_PAGE))),p={lastModified:r.getTime(),value:{kind:ih.APP_PAGE,html:t,rscData:s,postponed:null==n?void 0:n.postponed,headers:null==n?void 0:n.headers,status:null==n?void 0:n.status,segmentData:i}}}else if(h===ip.PAGES){let e,n={};c.isFallback||(n=JSON.parse(await this.fs.readFile(this.getFilePath(`${u}${e8}`,ip.PAGES),"utf8"))),p={lastModified:r.getTime(),value:{kind:ih.PAGES,html:t,pageData:n,headers:null==e?void 0:e.headers,status:null==e?void 0:e.status}}}else throw Object.defineProperty(Error(`Invariant: Unexpected route kind ${h} in file system cache.`),"__NEXT_ERROR_CODE",{value:"E445",enumerable:!1,configurable:!0})}p&&(null==(l=ix.memoryCache)||l.set(u,p))}catch{return null}if("allowStale"in c&&c.allowStale)return ix.debug&&console.log("FileSystemCache: allow stale",c.allowStale),p??null;if((null==p||null==(r=p.value)?void 0:r.kind)===ih.APP_PAGE||(null==p||null==(n=p.value)?void 0:n.kind)===ih.APP_ROUTE||(null==p||null==(i=p.value)?void 0:i.kind)===ih.PAGES){let e=null==(d=p.value.headers)?void 0:d[e6];if("string"==typeof e){let t=e.split(",");if(t.length>0&&(0,iv.isStale)(t,p.lastModified))return ix.debug&&console.log("FileSystemCache: stale tags",t),null}}else if((null==p||null==(s=p.value)?void 0:s.kind)===ih.FETCH){let e=c.kind===ip.FETCH?[...c.tags||[],...c.softTags||[]]:[];if(e.some(e=>this.revalidatedTags.includes(e)))return ix.debug&&console.log("FileSystemCache: was revalidated",e),null;if((0,iv.isStale)(e,p.lastModified))return ix.debug&&console.log("FileSystemCache: stale tags",e),null}return p??null}async set(e,t,r){var n;if(null==(n=ix.memoryCache)||n.set(e,{value:t,lastModified:Date.now()}),ix.debug&&console.log("FileSystemCache: set",e),!this.flushToDisk||!t)return;let i=new i_(this.fs);if(t.kind===ih.APP_ROUTE){let r=this.getFilePath(`${e}.body`,ip.APP_ROUTE);i.append(r,t.body);let n={headers:t.headers,status:t.status,postponed:void 0,segmentPaths:void 0};i.append(r.replace(/\.body$/,e5),JSON.stringify(n,null,2))}else if(t.kind===ih.PAGES||t.kind===ih.APP_PAGE){let n=t.kind===ih.APP_PAGE,s=this.getFilePath(`${e}.html`,n?ip.APP_PAGE:ip.PAGES);if(i.append(s,t.html),r.fetchCache||r.isFallback||i.append(this.getFilePath(`${e}${n?r.isRoutePPREnabled?e4:e3:e8}`,n?ip.APP_PAGE:ip.PAGES),n?t.rscData:JSON.stringify(t.pageData)),(null==t?void 0:t.kind)===ih.APP_PAGE){let e;if(t.segmentData){e=[];let r=s.replace(/\.html$/,e2);for(let[n,s]of t.segmentData){e.push(n);let t=r+n+e9;i.append(t,s)}}let r={headers:t.headers,status:t.status,postponed:t.postponed,segmentPaths:e};i.append(s.replace(/\.html$/,e5),JSON.stringify(r))}}else if(t.kind===ih.FETCH){let n=this.getFilePath(e,ip.FETCH);i.append(n,JSON.stringify({...t,tags:r.fetchCache?r.tags:[]}))}await i.wait()}getFilePath(e,t){switch(t){case ip.FETCH:return r8().join(this.serverDistDir,"..","cache","fetch-cache",e);case ip.PAGES:return r8().join(this.serverDistDir,"pages",e);case ip.IMAGE:case ip.APP_PAGE:case ip.APP_ROUTE:return r8().join(this.serverDistDir,"app",e);default:throw Object.defineProperty(Error(`Unexpected file path kind: ${t}`),"__NEXT_ERROR_CODE",{value:"E479",enumerable:!1,configurable:!0})}}}let iE=require("next/dist/server/lib/incremental-cache/shared-cache-controls.external.js");class iw{static #e=this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;constructor({fs:e,dev:t,flushToDisk:r,minimalMode:n,serverDistDir:i,requestHeaders:s,maxMemoryCacheSize:a,getPrerenderManifest:o,fetchCacheKeyPrefix:l,CurCacheHandler:d,allowedRevalidateHeaderKeys:u}){var c,h,p,f;this.locks=new Map,this.hasCustomCacheHandler=!!d;let m=Symbol.for("@next/cache-handlers"),g=globalThis;if(d)iw.debug&&console.log("IncrementalCache: using custom cache handler",d.name);else{let t=g[m];(null==t?void 0:t.FetchCache)?d=t.FetchCache:e&&i&&(iw.debug&&console.log("IncrementalCache: using filesystem cache handler"),d=ix)}process.env.__NEXT_TEST_MAX_ISR_CACHE&&(a=parseInt(process.env.__NEXT_TEST_MAX_ISR_CACHE,10)),this.dev=t,this.disableForTestmode="true"===process.env.NEXT_PRIVATE_TEST_PROXY,this.minimalMode=n,this.requestHeaders=s,this.allowedRevalidateHeaderKeys=u,this.prerenderManifest=o(),this.cacheControls=new iE.SharedCacheControls(this.prerenderManifest),this.fetchCacheKeyPrefix=l;let y=[];s["x-prerender-revalidate"]===(null==(h=this.prerenderManifest)||null==(c=h.preview)?void 0:c.previewModeId)&&(this.isOnDemandRevalidate=!0),n&&(y=this.revalidatedTags=rK(s,null==(f=this.prerenderManifest)||null==(p=f.preview)?void 0:p.previewModeId)),d&&(this.cacheHandler=new d({dev:t,fs:e,flushToDisk:r,serverDistDir:i,revalidatedTags:y,maxMemoryCacheSize:a,_requestHeaders:s,fetchCacheKeyPrefix:l}))}calculateRevalidate(e,t,r,n){if(r)return Math.floor(performance.timeOrigin+performance.now()-1e3);let i=this.cacheControls.get(nN(e)),s=i?i.revalidate:!n&&1;return"number"==typeof s?1e3*s+t:s}_getPathname(e,t){return t?e:r6(e)}resetRequestCache(){var e,t;null==(t=this.cacheHandler)||null==(e=t.resetRequestCache)||e.call(t)}async lock(e){for(;;){let t=this.locks.get(e);if(iw.debug&&console.log("IncrementalCache: lock get",e,!!t),!t)break;await t}let{resolve:t,promise:r}=new rc;return iw.debug&&console.log("IncrementalCache: successfully locked",e),this.locks.set(e,r),()=>{t(),this.locks.delete(e)}}async revalidateTag(e){var t;return null==(t=this.cacheHandler)?void 0:t.revalidateTag(e)}async generateCacheKey(e,t={}){let n=[],i=new TextEncoder,s=new TextDecoder;if(t.body)if(t.body instanceof Uint8Array)n.push(s.decode(t.body)),t._ogBody=t.body;else if("function"==typeof t.body.getReader){let e=t.body,r=[];try{await e.pipeTo(new WritableStream({write(e){"string"==typeof e?(r.push(i.encode(e)),n.push(e)):(r.push(e),n.push(s.decode(e,{stream:!0})))}})),n.push(s.decode());let a=r.reduce((e,t)=>e+t.length,0),o=new Uint8Array(a),l=0;for(let e of r)o.set(e,l),l+=e.length;t._ogBody=o}catch(e){console.error("Problem reading body",e)}}else if("function"==typeof t.body.keys){let e=t.body;for(let r of(t._ogBody=t.body,new Set([...e.keys()]))){let t=e.getAll(r);n.push(`${r}=${(await Promise.all(t.map(async e=>"string"==typeof e?e:await e.text()))).join(",")}`)}}else if("function"==typeof t.body.arrayBuffer){let e=t.body,r=await e.arrayBuffer();n.push(await e.text()),t._ogBody=new Blob([r],{type:e.type})}else"string"==typeof t.body&&(n.push(t.body),t._ogBody=t.body);let a="function"==typeof(t.headers||{}).keys?Object.fromEntries(t.headers):Object.assign({},t.headers);"traceparent"in a&&delete a.traceparent,"tracestate"in a&&delete a.tracestate;let o=JSON.stringify(["v3",this.fetchCacheKeyPrefix||"",e,t.method,a,t.mode,t.redirect,t.credentials,t.referrer,t.referrerPolicy,t.integrity,t.cache,n]);return r("crypto").createHash("sha256").update(o).digest("hex")}async get(e,t){var r,n,i,s,a,o,l;let d,u;if(t.kind===ip.FETCH){let t=j.workUnitAsyncStorage.getStore(),r=t?(0,j.getRenderResumeDataCache)(t):null;if(r){let t=r.fetch.get(e);if((null==t?void 0:t.kind)===ih.FETCH)return iw.debug&&console.log("IncrementalCache: rdc:hit",e),{isStale:!1,value:t};iw.debug&&console.log("IncrementalCache: rdc:miss",e)}else iw.debug&&console.log("IncrementalCache: rdc:no-resume-data")}if(this.disableForTestmode||this.dev&&(t.kind!==ip.FETCH||"no-cache"===this.requestHeaders["cache-control"]))return null;e=this._getPathname(e,t.kind===ip.FETCH);let c=await (null==(r=this.cacheHandler)?void 0:r.get(e,t));if(t.kind===ip.FETCH){if(!c)return null;if((null==(i=c.value)?void 0:i.kind)!==ih.FETCH)throw Object.defineProperty(new eh(`Expected cached value for cache key ${JSON.stringify(e)} to be a "FETCH" kind, got ${JSON.stringify(null==(s=c.value)?void 0:s.kind)} instead.`),"__NEXT_ERROR_CODE",{value:"E653",enumerable:!1,configurable:!0});let r=eu.workAsyncStorage.getStore();if([...t.tags||[],...t.softTags||[]].some(e=>{var t,n;return(null==(t=this.revalidatedTags)?void 0:t.includes(e))||(null==r||null==(n=r.pendingRevalidatedTags)?void 0:n.includes(e))}))return iw.debug&&console.log("IncrementalCache: stale tag",e),null;let n=j.workUnitAsyncStorage.getStore();if(n){let t=(0,j.getPrerenderResumeDataCache)(n);t&&(iw.debug&&console.log("IncrementalCache: rdc:set",e),t.fetch.set(e,c.value))}let a=t.revalidate||c.value.revalidate,o=(performance.timeOrigin+performance.now()-(c.lastModified||0))/1e3,l=c.value.data;return{isStale:o>a,value:{kind:ih.FETCH,data:l,revalidate:a}}}if((null==c||null==(n=c.value)?void 0:n.kind)===ih.FETCH)throw Object.defineProperty(new eh(`Expected cached value for cache key ${JSON.stringify(e)} not to be a ${JSON.stringify(t.kind)} kind, got "FETCH" instead.`),"__NEXT_ERROR_CODE",{value:"E652",enumerable:!1,configurable:!0});let h=null,p=this.cacheControls.get(nN(e));if((null==c?void 0:c.lastModified)===-1)d=-1,u=-31536e3;else{let r=performance.timeOrigin+performance.now(),n=(null==c?void 0:c.lastModified)||r;if(void 0===(d=!1!==(u=this.calculateRevalidate(e,n,this.dev??!1,t.isFallback))&&u<r||void 0)&&((null==c||null==(a=c.value)?void 0:a.kind)===ih.APP_PAGE||(null==c||null==(o=c.value)?void 0:o.kind)===ih.APP_ROUTE)){let e=null==(l=c.value.headers)?void 0:l[e6];if("string"==typeof e){let t=e.split(",");t.length>0&&(0,iv.isStale)(t,n)&&(d=-1)}}}return c&&(h={isStale:d,cacheControl:p,revalidateAfter:u,value:c.value}),!c&&this.prerenderManifest.notFoundRoutes.includes(e)&&(h={isStale:d,value:null,cacheControl:p,revalidateAfter:u},this.set(e,h.value,{...t,cacheControl:p})),h}async set(e,t,r){if((null==t?void 0:t.kind)===ih.FETCH){let r=j.workUnitAsyncStorage.getStore(),n=r?(0,j.getPrerenderResumeDataCache)(r):null;n&&(iw.debug&&console.log("IncrementalCache: rdc:set",e),n.fetch.set(e,t))}if(this.disableForTestmode||this.dev&&!r.fetchCache)return;e=this._getPathname(e,r.fetchCache);let n=JSON.stringify(t).length;if(r.fetchCache&&n>2097152&&!this.hasCustomCacheHandler&&!r.isImplicitBuildTimeCache){let t=`Failed to set Next.js data cache for ${r.fetchUrl||e}, items over 2MB can not be cached (${n} bytes)`;if(this.dev)throw Object.defineProperty(Error(t),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});console.warn(t);return}try{var i;!r.fetchCache&&r.cacheControl&&this.cacheControls.set(nN(e),r.cacheControl),await (null==(i=this.cacheHandler)?void 0:i.set(e,t,r))}catch(t){console.warn("Failed to update prerender cache for",e,t)}}}let iC=require("http"),iR=require("https"),iP={existsSync:eO().existsSync,readFile:eO().promises.readFile,readFileSync:eO().readFileSync,writeFile:(e,t)=>eO().promises.writeFile(e,t),mkdir:e=>eO().promises.mkdir(e,{recursive:!0}),stat:e=>eO().promises.stat(e)};class iT extends id().Readable{constructor({url:e,headers:t,method:r,socket:n=null,readable:i}){super(),this.httpVersion="1.0",this.httpVersionMajor=1,this.httpVersionMinor=0,this.socket=new Proxy({},{get:(e,t)=>{if("encrypted"!==t&&"remoteAddress"!==t)throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0});if("remoteAddress"!==t)return!1}}),this.url=e,this.headers=t,this.method=r,i&&(this.bodyReadable=i,this.bodyReadable.on("end",()=>this.emit("end")),this.bodyReadable.on("close",()=>this.emit("close"))),n&&(this.socket=n)}get headersDistinct(){let e={};for(let[t,r]of Object.entries(this.headers))r&&(e[t]=Array.isArray(r)?r:[r]);return e}_read(e){if(this.bodyReadable)return this.bodyReadable._read(e);this.emit("end"),this.emit("close")}get connection(){return this.socket}get aborted(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0})}get complete(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0})}get trailers(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0})}get trailersDistinct(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0})}get rawTrailers(){throw Object.defineProperty(Error("Method not implemented"),"__NEXT_ERROR_CODE",{value:"E52",enumerable:!1,configurable:!0})}get rawHeaders(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}setTimeout(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}}class iO extends id().Writable{constructor(e={}){super(),this.statusMessage="",this.finished=!1,this.headersSent=!1,this.buffers=[],this.statusCode=e.statusCode??200,this.socket=e.socket??null,this.headers=e.headers?function(e){let t=new Headers;for(let[r,n]of Object.entries(e))for(let e of Array.isArray(n)?n:[n])void 0!==e&&("number"==typeof e&&(e=e.toString()),t.append(r,e));return t}(e.headers):new Headers,this.headPromise=new Promise(e=>{this.headPromiseResolve=e}),this.hasStreamed=new Promise((e,t)=>{this.on("finish",()=>e(!0)),this.on("end",()=>e(!0)),this.on("error",e=>t(e))}).then(e=>(null==this.headPromiseResolve||this.headPromiseResolve.call(this),e)),e.resWriter&&(this.resWriter=e.resWriter)}appendHeader(e,t){for(let r of Array.isArray(t)?t:[t])this.headers.append(e,r);return this}get isSent(){return this.finished||this.headersSent}get connection(){return this.socket}write(e){return this.resWriter?this.resWriter(e):(this.buffers.push(Buffer.isBuffer(e)?e:Buffer.from(e)),!0)}end(){return this.finished=!0,super.end(...arguments)}_implicitHeader(){}_write(e,t,r){this.write(e),r()}writeHead(e,t,r){if(r||"string"==typeof t?"string"==typeof t&&t.length>0&&(this.statusMessage=t):r=t,r)if(Array.isArray(r))for(let e=0;e<r.length;e+=2)this.setHeader(r[e],r[e+1]);else for(let[e,t]of Object.entries(r))void 0!==t&&this.setHeader(e,t);return this.statusCode=e,this.headersSent=!0,null==this.headPromiseResolve||this.headPromiseResolve.call(this),this}hasHeader(e){return this.headers.has(e)}getHeader(e){return this.headers.get(e)??void 0}getHeaders(){return tK(this.headers)}getHeaderNames(){return Array.from(this.headers.keys())}setHeader(e,t){if(Array.isArray(t))for(let r of(this.headers.delete(e),t))this.headers.append(e,r);else"number"==typeof t?this.headers.set(e,t.toString()):this.headers.set(e,t);return this}removeHeader(e){this.headers.delete(e)}flushHeaders(){}get strictContentLength(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}writeEarlyHints(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get req(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}assignSocket(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}detachSocket(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}writeContinue(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}writeProcessing(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get upgrading(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get chunkedEncoding(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get shouldKeepAlive(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get useChunkedEncodingByDefault(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}get sendDate(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}setTimeout(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}addTrailers(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}setHeaders(){throw Object.defineProperty(Error("Method not implemented."),"__NEXT_ERROR_CODE",{value:"E41",enumerable:!1,configurable:!0})}}let iS=(e,t)=>{let r=_().isAbsolute(t)?t:_().join(e,t);return(0,b.pathToFileURL)(r).toString()};class iI{add(e){this.callbacks.push(e)}async runAll(){if(!this.callbacks.length)return;let e=this.callbacks;this.callbacks=[],await Promise.allSettled(e.map(async e=>e()))}constructor(){this.callbacks=[]}}let ik=Symbol.for("react.postpone");function iA(e){return"object"==typeof e&&null!==e&&e.$$typeof===ik}class ij{async load(e){return await require(e)}}let iN=require("next/dist/server/lib/router-utils/instrumentation-globals.external.js"),iD=Symbol.for("@next/router-server-methods"),i$=globalThis,iM=e=>import(e).then(e=>e.default||e),iZ=new WeakMap;class iL extends n0{constructor(e){var t,r,n;super(e),this.cleanupListeners=new iI,this.handleNextImageRequest=async(e,t,r)=>!(!r.pathname||!r.pathname.startsWith("/_next/image")||eM(e,"middlewareInvoke"))&&(t.statusCode=400,t.body("Bad Request").send(),!0),this.handleCatchallRenderRequest=async(e,t,r)=>{let{pathname:n,query:i}=r;if(!n)throw Object.defineProperty(Error("Invariant: pathname is undefined"),"__NEXT_ERROR_CODE",{value:"E409",enumerable:!1,configurable:!0});eZ(e,"bubbleNoFallback",void 0),i$[iD]||(i$[iD]={});let s=(0,v.relative)(process.cwd(),this.dir);i$[iD][s]||(i$[iD][s]={render404:this.render404.bind(this)}),i$[iD][s].nextConfig=this.nextConfig;try{var a;n=tQ(n);let s={i18n:null==(a=this.i18nProvider)?void 0:a.fromRequest(e,n)},o=await this.matchers.match(n,s);if(!o)return await this.render(e,t,n,i,r,!0),!0;for(let n of(eZ(e,"match",o),this.getEdgeFunctionsPages()))if(n===o.definition.page){if("export"===this.nextConfig.output)return await this.render404(e,t,r),!0;delete i[rX];try{if(await this.runEdgeFunction({req:e,res:t,query:i,params:o.params,page:o.definition.page,match:o,appPaths:null}))return!0}catch(t){throw await this.instrumentationOnRequestError(t,e,{routePath:o.definition.page,routerKind:"Pages Router",routeType:"route",revalidateReason:void 0}),t}}if(o.definition.kind===nl.PAGES_API){if("export"===this.nextConfig.output)return await this.render404(e,t,r),!0;if(await this.handleApiRequest(e,t,i,o))return!0}return await this.render(e,t,n,i,r,!0),!0}catch(r){if(r instanceof nK.NoFallbackError)throw r;try{return this.logError(r),t.statusCode=500,await this.renderError(r,e,t,n,i),!0}catch{}throw r}},this.handleCatchallMiddlewareRequest=async(e,t,r)=>{let n,i=eM(e,"middlewareInvoke");if(!i)return!1;let s=()=>(eZ(e,"middlewareInvoke",!0),t.body("").send(),!0),a=await this.getMiddleware();if(!a)return s();let o=tf(eM(e,"initURL")),l=t6(o.pathname,{nextConfig:this.nextConfig,i18nProvider:this.i18nProvider});o.pathname=l.pathname;let d=tQ(r.pathname||""),u=d;try{u=decodeURIComponent(d)}catch{}if(!(a.match(d,e,o.query)||a.match(u,e,o.query)))return s();let c=!1;try{if(await this.ensureMiddleware(e.url),n=await this.runMiddleware({request:e,response:t,parsedUrl:o,parsed:r}),"response"in n){if(i)throw c=!0,Object.defineProperty(new tt.BubbledError(!0,n),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});for(let[e,r]of Object.entries(tK(n.response.headers)))"content-encoding"!==e&&void 0!==r&&t.setHeader(e,r);t.statusCode=n.response.status;let{originalResponse:e}=t;return n.response.body?await r_(n.response.body,e):e.end(),!0}}catch(i){if(c)throw i;if(rY(i)&&"ENOENT"===i.code)return await this.render404(e,t,r),!0;if(i instanceof ew)return t.statusCode=400,await this.renderError(i,e,t,r.pathname||""),!0;let n=rJ(i);return console.error(n),t.statusCode=500,await this.renderError(n,e,t,r.pathname||""),!0}return n.finished};let i=e.dev??!1;if(this.isDev=i,this.sriEnabled=!!(null==(r=e.conf.experimental)||null==(t=r.sri)?void 0:t.algorithm),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.experimental.useSkewCookie?"":this.nextConfig.deploymentId||"",e.dev,!e.dev){let{dynamicRoutes:e=[]}=this.getRoutesManifest()??{};this.dynamicRoutes=e.map(e=>{let t=rS(e.page);return{match:eD(t),page:e.page,re:t.re}})}!function(e){if(!globalThis.__NEXT_HTTP_AGENT){if(!e)throw Object.defineProperty(Error("Expected config.httpAgentOptions to be an object"),"__NEXT_ERROR_CODE",{value:"E204",enumerable:!1,configurable:!0});globalThis.__NEXT_HTTP_AGENT_OPTIONS=e.httpAgentOptions,globalThis.__NEXT_HTTP_AGENT=new iC.Agent(e.httpAgentOptions),globalThis.__NEXT_HTTPS_AGENT=new iR.Agent(e.httpAgentOptions)}}(this.nextConfig),this.middlewareManifestPath=(0,v.join)(this.serverDistDir,"middleware-manifest.json"),e.dev||this.prepare().catch(e=>{console.error("Failed to prepare server",e)}),this.renderOpts.isExperimentalCompile&&function(e){let t={...function(){let e=[];for(let t in process.env)if(t.startsWith("NEXT_PUBLIC_")){let r=process.env[t];null!=r&&e.push([`process.env.${t}`,r])}return e.sort((e,t)=>e[0].localeCompare(t[0])),Object.fromEntries(e)}(),...function(e){let t={},r=e.env;for(let n in r){let i=r[n];if(null!=i){let r=/^(?:NODE_.+)|^(?:__.+)$/i.test(n),s="NEXT_RUNTIME"===n;if(r||s)throw Object.defineProperty(Error(`The key "${n}" under "env" in ${e.configFileName} is not allowed. https://nextjs.org/docs/messages/env-key-not-allowed`),"__NEXT_ERROR_CODE",{value:"E170",enumerable:!1,configurable:!0});t[`process.env.${n}`]=i}}return t}(e),"process.env.NEXT_DEPLOYMENT_ID":e.deploymentId||""};for(let e in t){let r=e.split(".").pop()||"";process.env[r]||(process.env[r]=t[e]||"")}}(this.nextConfig),(null==(n=e.conf.experimental)?void 0:n.removeUncaughtErrorAndRejectionListeners)&&(process.removeAllListeners("uncaughtException"),process.removeAllListeners("unhandledRejection")),process.on("unhandledRejection",e=>{iA(e)||console.error(e)}),process.on("rejectionHandled",()=>{}),process.on("uncaughtException",e=>{iA(e)||console.error(e)})}async unstable_preloadEntries(){await this.prepare();let e=this.getAppPathsManifest(),t=this.getPagesManifest();for(let e of(await this.loadCustomCacheHandlers(),Object.keys(t||{})))try{await is({distDir:this.distDir,page:e,isAppPath:!1,isDev:this.isDev,sriEnabled:this.sriEnabled,needsManifestsForLegacyReasons:!1})}catch(e){}for(let t of Object.keys(e||{}))try{let{ComponentMod:e}=await is({distDir:this.distDir,page:t,isAppPath:!0,isDev:this.isDev,sriEnabled:this.sriEnabled,needsManifestsForLegacyReasons:!1});e.patchFetch()}catch(e){}}async handleUpgrade(){}async loadInstrumentationModule(){if(!this.serverOptions.dev)try{this.instrumentation=await (0,iN.getInstrumentationModule)(this.dir,this.nextConfig.distDir)}catch(e){if("MODULE_NOT_FOUND"!==e.code)throw Object.defineProperty(Error("An error occurred while loading the instrumentation hook",{cause:e}),"__NEXT_ERROR_CODE",{value:"E92",enumerable:!1,configurable:!0})}return this.instrumentation}async prepareImpl(){await super.prepareImpl(),await this.runInstrumentationHookIfAvailable()}async runInstrumentationHookIfAvailable(){await (0,iN.ensureInstrumentationRegistered)(this.dir,this.nextConfig.distDir)}loadEnvConfig({dev:e,forceReload:t}){(0,io.loadEnvConfig)(this.dir,e,g,t,t?e=>{tw(`Reload env: ${e}`)}:void 0)}async loadCustomCacheHandlers(){let{cacheHandlers:e}=this.nextConfig.experimental;if(e&&function(){if(nW[nH])return null==nz||nz("cache handlers already initialized"),!1;if(null==nz||nz("initializing cache handlers"),nW[nH]=new Map,nW[nF]){let e;nW[nF].DefaultCache?(null==nz||nz('setting "default" cache handler from symbol'),e=nW[nF].DefaultCache):(null==nz||nz('setting "default" cache handler from default'),e=nU()),nW[nH].set("default",e),nW[nF].RemoteCache?(null==nz||nz('setting "remote" cache handler from symbol'),nW[nH].set("remote",nW[nF].RemoteCache)):(null==nz||nz('setting "remote" cache handler from default'),nW[nH].set("remote",e))}else null==nz||nz('setting "default" cache handler from default'),nW[nH].set("default",nU()),null==nz||nz('setting "remote" cache handler from default'),nW[nH].set("remote",nU());return nW[nV]=new Set(nW[nH].values()),!0}()){for(let[r,n]of Object.entries(e))if(n){var t=n8(await iM(iS(this.distDir,n)));if(!nW[nH]||!nW[nV])throw Object.defineProperty(Error("Cache handlers not initialized"),"__NEXT_ERROR_CODE",{value:"E649",enumerable:!1,configurable:!0});null==nz||nz('setting cache handler for "%s"',r),nW[nH].set(r,t),nW[nV].add(t)}}}async getIncrementalCache({requestHeaders:e}){let t,{cacheHandler:r}=this.nextConfig;return r&&(t=n8(await iM(iS(this.distDir,r)))),await this.loadCustomCacheHandlers(),new iw({fs:this.getCacheFilesystem(),dev:!1,requestHeaders:e,allowedRevalidateHeaderKeys:this.nextConfig.experimental.allowedRevalidateHeaderKeys,minimalMode:!0,serverDistDir:this.serverDistDir,fetchCacheKeyPrefix:this.nextConfig.experimental.fetchCacheKeyPrefix,maxMemoryCacheSize:this.nextConfig.cacheMaxMemorySize,flushToDisk:!1,getPrerenderManifest:()=>this.getPrerenderManifest(),CurCacheHandler:t})}getResponseCache(){return new iy(!0)}getPublicDir(){return(0,v.join)(this.dir,"public")}getHasStaticDir(){return eO().existsSync((0,v.join)(this.dir,"static"))}getPagesManifest(){return(0,n1.loadManifest)((0,v.join)(this.serverDistDir,eF))}getAppPathsManifest(){if(this.enabledDirectories.app)return(0,n1.loadManifest)((0,v.join)(this.serverDistDir,eH))}getinterceptionRoutePatterns(){if(!this.enabledDirectories.app)return[];let e=this.getRoutesManifest();return(null==e?void 0:e.rewrites.beforeFiles.filter(rB).map(e=>new RegExp(e.regex)))??[]}async hasPage(e){var t;return!!n2(e,this.distDir,null==(t=this.nextConfig.i18n)?void 0:t.locales,this.enabledDirectories.app)}getBuildId(){let e=(0,v.join)(this.distDir,"BUILD_ID");try{return eO().readFileSync(e,"utf8").trim()}catch(e){if("ENOENT"===e.code)throw Object.defineProperty(Error(`Could not find a production build in the '${this.distDir}' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id`),"__NEXT_ERROR_CODE",{value:"E427",enumerable:!1,configurable:!0});throw e}}getEnabledDirectories(e){let t=e?this.dir:this.serverDistDir;return{app:!!eB(t,"app"),pages:!!eB(t,"pages")}}sendRenderResult(e,t,r){return tc({req:e.originalRequest,res:t.originalResponse,result:r.result,generateEtags:r.generateEtags,poweredByHeader:r.poweredByHeader,cacheControl:r.cacheControl})}async runApi(e,t,r,n){for(let i of this.getEdgeFunctionsPages())if(i===n.definition.pathname&&await this.runEdgeFunction({req:e,res:t,query:r,params:n.params,page:n.definition.pathname,appPaths:null}))return!0;let i=tf(eM(e,"initURL")||e.url);e.url=`${i.pathname}${i.search||""}`;let s=new ij,a=await s.load(n.definition.filename);return eZ(e.originalRequest,"relativeProjectDir",(0,v.relative)(process.cwd(),this.dir)),eZ(e.originalRequest,"distDir",this.distDir),await a.handler(e.originalRequest,t.originalResponse,{waitUntil:this.getWaitUntil()}),!0}async renderHTML(e,t,r,n,i){return(0,tt.getTracer)().trace(rf.renderHTML,async()=>this.renderHTMLImpl(e,t,r,n,i))}async renderHTMLImpl(e,t,r,n,i){throw Object.defineProperty(Error("Invariant: renderHTML should not be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E472",enumerable:!1,configurable:!0})}async imageOptimizer(e,t,r,n){throw Object.defineProperty(Error("invariant: imageOptimizer should not be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E506",enumerable:!1,configurable:!0})}getPagePath(e,t){return n9(e,this.distDir,t,this.enabledDirectories.app)}async renderPageComponent(e,t){let r=this.getEdgeFunctionsPages()||[];if(r.length){let t=this.getOriginalAppPaths(e.pathname),n=Array.isArray(t),i=e.pathname;for(let s of(n&&(i=t[0]),r))if(s===i)return await this.runEdgeFunction({req:e.req,res:e.res,query:e.query,params:e.renderOpts.params,page:i,appPaths:t}),null}return super.renderPageComponent(e,t)}async findPageComponents({locale:e,page:t,query:r,params:n,isAppPath:i,url:s}){return(0,tt.getTracer)().trace(rf.findPageComponents,{spanName:"resolve page components",attributes:{"next.route":i?tj(t):t}},()=>this.findPageComponentsImpl({locale:e,page:t,query:r,params:n,isAppPath:i,url:s}))}async findPageComponentsImpl({locale:e,page:t,query:r,params:n,isAppPath:i,url:s}){let a=[t];for(let s of(r.amp&&a.unshift((i?tj(t):r6(t))+".amp"),e&&a.unshift(...a.map(t=>`/${e}${"/"===t?"":t}`)),a))try{let t=await is({distDir:this.distDir,page:s,isAppPath:i,isDev:this.isDev,sriEnabled:this.sriEnabled,needsManifestsForLegacyReasons:!1});if(e&&"string"==typeof t.Component&&!s.startsWith(`/${e}/`)&&s!==`/${e}`)continue;return{components:t,query:{...!this.renderOpts.isExperimentalCompile&&t.getStaticProps?{amp:r.amp}:r,...(i?{}:n)||{}}}}catch(e){if(!(e instanceof eR))throw e}return null}getNextFontManifest(){return(0,n1.loadManifest)((0,v.join)(this.distDir,"server","next-font-manifest.json"))}logErrorWithOriginalStack(e,t){throw Object.defineProperty(Error("Invariant: logErrorWithOriginalStack can only be called on the development server"),"__NEXT_ERROR_CODE",{value:"E6",enumerable:!1,configurable:!0})}async ensurePage(e){throw Object.defineProperty(Error("Invariant: ensurePage can only be called on the development server"),"__NEXT_ERROR_CODE",{value:"E291",enumerable:!1,configurable:!0})}async handleApiRequest(e,t,r,n){return this.runApi(e,t,r,n)}getCacheFilesystem(){return iP}normalizeReq(e){return e instanceof to?e:new to(e)}normalizeRes(e){return e instanceof tl?e:new tl(e)}getRequestHandler(){return this.makeRequestHandler()}makeRequestHandler(){this.prepare().catch(e=>{console.error("Failed to prepare server",e)});let e=super.getRequestHandler();return(t,r,n)=>e(this.normalizeReq(t),this.normalizeRes(r),n)}async revalidate({urlPath:e,revalidateHeaders:t,opts:r}){let n=function({url:e,headers:t={},method:r="GET",bodyReadable:n,resWriter:i,socket:s=null}){return{req:new iT({url:e,headers:t,method:r,socket:s,readable:n}),res:new iO({socket:s,resWriter:i})}}({url:e,headers:t}),i=this.getRequestHandler();if(await i(new to(n.req),new tl(n.res)),await n.res.hasStreamed,"REVALIDATED"!==n.res.getHeader("x-nextjs-cache")&&200!==n.res.statusCode&&!(404===n.res.statusCode&&r.unstable_onlyGenerated))throw Object.defineProperty(Error(`Invalid response ${n.res.statusCode}`),"__NEXT_ERROR_CODE",{value:"E175",enumerable:!1,configurable:!0})}async render(e,t,r,n,i,s=!1){return super.render(this.normalizeReq(e),this.normalizeRes(t),r,n,i,s)}async renderToHTML(e,t,r,n){return super.renderToHTML(this.normalizeReq(e),this.normalizeRes(t),r,n)}async renderErrorToResponseImpl(e,t){let{req:r,res:n,query:i}=e;return 404===n.statusCode&&this.enabledDirectories.app&&this.getEdgeFunctionsPages().includes(eU)?(await this.runEdgeFunction({req:r,res:n,query:i||{},params:{},page:eU,appPaths:null}),null):super.renderErrorToResponseImpl(e,t)}async renderError(e,t,r,n,i,s){return super.renderError(e,this.normalizeReq(t),this.normalizeRes(r),n,i,s)}async renderErrorToHTML(e,t,r,n,i){return super.renderErrorToHTML(e,this.normalizeReq(t),this.normalizeRes(r),n,i)}async render404(e,t,r,n){return super.render404(this.normalizeReq(e),this.normalizeRes(t),r,n)}getMiddlewareManifest(){return null}async getMiddleware(){var e,t;let r=this.getMiddlewareManifest(),n=null==r||null==(e=r.middleware)?void 0:e["/"];if(!n){let e=await this.loadNodeMiddleware();return e?{match:ia((null==(t=e.config)?void 0:t.matchers)||[{regexp:".*",originalSource:"/:path*"}]),page:"/"}:void 0}return{match:function(e){let t=iZ.get(e);if(t)return t;if(!Array.isArray(e.matchers))throw Object.defineProperty(Error(`Invariant: invalid matchers for middleware ${JSON.stringify(e)}`),"__NEXT_ERROR_CODE",{value:"E257",enumerable:!1,configurable:!0});let r=ia(e.matchers);return iZ.set(e,r),r}(n),page:"/"}}getEdgeFunctionsPages(){let e=this.getMiddlewareManifest();return e?Object.keys(e.functions):[]}getEdgeFunctionInfo(e){let t,r=this.getMiddlewareManifest();if(!r)return null;try{t=rE(r6(e.page))}catch(e){return null}let n=e.middleware?r.middleware[t]:r.functions[t];if(!n){if(!e.middleware)throw new eR(t);return null}return{name:n.name,paths:n.files.map(e=>(0,v.join)(this.distDir,e)),wasm:(n.wasm??[]).map(e=>({...e,filePath:(0,v.join)(this.distDir,e.filePath)})),assets:n.assets&&n.assets.map(e=>({...e,filePath:(0,v.join)(this.distDir,e.filePath)})),env:n.env}}async loadNodeMiddleware(){}async hasMiddleware(e){let t=this.getEdgeFunctionInfo({page:e,middleware:!0}),r=await this.loadNodeMiddleware();return!t&&!!r||!!(t&&t.paths.length>0)}async ensureMiddleware(e){}async ensureEdgeFunction(e){}async runMiddleware(e){throw Object.defineProperty(Error("invariant: runMiddleware should not be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E276",enumerable:!1,configurable:!0})}getPrerenderManifest(){return this._cachedPreviewManifest||(this._cachedPreviewManifest=(0,n1.loadManifest)((0,v.join)(this.distDir,"prerender-manifest.json"))),this._cachedPreviewManifest}getRoutesManifest(){return(0,tt.getTracer)().trace(rf.getRoutesManifest,()=>(0,n1.loadManifest)((0,v.join)(this.distDir,"routes-manifest.json")))}attachRequestMeta(e,t,r){var n;let i=(null==(n=e.headers["x-forwarded-proto"])?void 0:n.includes("https"))?"https":"http",s=this.fetchHostname&&this.port?`${i}://${this.fetchHostname}:${this.port}${e.url}`:this.nextConfig.experimental.trustHostHeader?`https://${e.headers.host||"localhost"}${e.url}`:e.url;eZ(e,"initURL",s),eZ(e,"initQuery",{...t.query}),eZ(e,"initProtocol",i),r||eZ(e,"clonableBody",function(e){let t=null,r=new Promise((t,r)=>{e.on("end",t),e.on("error",r)}).catch(e=>({error:e}));return{async finalize(){if(t){let n=await r;if(n&&"object"==typeof n&&n.error)throw n.error;!function(e,t){for(let r in t){let n=t[r];"function"==typeof n&&(n=n.bind(e)),e[r]=n}}(e,t),t=e}},cloneBodyStream(){let r=t??e,n=new il.PassThrough,i=new il.PassThrough;return r.on("data",e=>{n.push(e),i.push(e)}),r.on("end",()=>{n.push(null),i.push(null)}),t=i,n}}}(e.originalRequest))}async runEdgeFunction(e){throw Object.defineProperty(Error("Middleware is not supported in minimal mode. Please remove the `NEXT_MINIMAL` environment variable."),"__NEXT_ERROR_CODE",{value:"E58",enumerable:!1,configurable:!0})}get serverDistDir(){if(this._serverDistDir)return this._serverDistDir;let e=(0,v.join)(this.distDir,eV);return this._serverDistDir=e,e}async getFallbackErrorComponents(e){return null}async instrumentationOnRequestError(...e){await super.instrumentationOnRequestError(...e),this.logError(e[0])}onServerClose(e){this.cleanupListeners.add(e)}async close(){await this.cleanupListeners.runAll()}getInternalWaitUntil(){return this.internalWaitUntil??=this.createInternalWaitUntil(),this.internalWaitUntil}createInternalWaitUntil(){throw Object.defineProperty(new eh("createInternalWaitUntil should never be called in minimal mode"),"__NEXT_ERROR_CODE",{value:"E540",enumerable:!1,configurable:!0})}}})(),module.exports=n})();
|
14
14
|
//# sourceMappingURL=server.runtime.prod.js.map
|