{"version":3,"sources":["webpack://_N_E/../../../../../next-server/lib/router/utils/is-dynamic.ts","webpack://_N_E/../../client/with-router.tsx","webpack://_N_E/../../client/request-idle-callback.ts","webpack://_N_E/./node_modules/@babel/runtime/helpers/interopRequireWildcard.js","webpack://_N_E/../../../../../next-server/lib/router/utils/querystring.ts","webpack://_N_E/../../../../next-server/lib/i18n/normalize-locale-path.ts","webpack://_N_E/../../../../../next-server/lib/router/utils/format-url.ts","webpack://_N_E/../../../../../next-server/lib/router/utils/resolve-rewrites-noop.ts","webpack://_N_E/./node_modules/@babel/runtime/helpers/slicedToArray.js","webpack://_N_E/../../../../../next-server/lib/router/utils/get-asset-path-from-route.ts","webpack://_N_E/../../client/route-loader.ts","webpack://_N_E/./node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack://_N_E/../../client/normalize-trailing-slash.ts","webpack://_N_E/../../../../../next-server/lib/router/utils/route-regex.ts","webpack://_N_E/./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js","webpack://_N_E/../../../next-server/lib/mitt.ts","webpack://_N_E/../../../../next-server/lib/router/router.ts","webpack://_N_E/../../../next-server/lib/utils.ts","webpack://_N_E/../../../../../next-server/lib/router/utils/route-matcher.ts","webpack://_N_E/../../../../../next-server/lib/router/utils/parse-relative-url.ts","webpack://_N_E/./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","webpack://_N_E/../../client/router.ts","webpack://_N_E/../../../next-server/lib/router-context.ts","webpack://_N_E/./node_modules/@babel/runtime/helpers/construct.js","webpack://_N_E/./node_modules/@babel/runtime/helpers/arrayWithHoles.js","webpack://_N_E/./node_modules/next/dist/next-server/server/denormalize-page-path.js","webpack://_N_E/./node_modules/@babel/runtime/helpers/nonIterableRest.js","webpack://_N_E/./node_modules/@babel/runtime/helpers/asyncToGenerator.js"],"names":["route","TEST_ROUTE","router","WithRouterWrapper","ComposedComponent","getInitialProps","requestIdleCallback","self","start","Date","setTimeout","cb","didTimeout","timeRemaining","Math","cancelIdleCallback","id","clearTimeout","_typeof","_getRequireWildcardCache","WeakMap","cache","module","exports","obj","__esModule","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","stringifyUrlQueryParam","param","isNaN","String","query","searchParams","Array","result","value","item","searchParamsList","target","pathnameParts","pathname","locales","locale","detectedLocale","urlObj","protocol","hash","host","auth","encodeURIComponent","hostname","querystring","search","slashedProtocols","arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest","arr","i","ext","path","test","err","ASSET_LOAD_ERROR","withFuture","entry","map","Promise","prom","resolve","resolver","future","generator","canPrefetch","link","document","window","hasPrefetch","Symbol","markAssetError","resolvePromiseWithTimeout","cancelled","p","r","reject","getClientBuildManifest","Error","getFilesForRoute","manifest","allFiles","assetPrefix","encodeURI","scripts","v","css","entrypoints","loadedScripts","styleSheets","routes","script","process","appendScript","fetch","res","text","href","content","whenEntrypoint","onEntrypoint","fn","component","error","input","old","loadRoute","entrypoint","styles","prefetch","cn","navigator","output","removePathTrailingSlash","normalizePathTrailingSlash","segments","normalizedRoute","groups","groupIndex","parameterizedRoute","segment","optional","repeat","parseParameter","pos","str","re","RegExp","Reflect","construct","sham","Proxy","toString","e","all","on","off","emit","handler","buildCancellationError","addLocale","delLocale","pathNoQueryHash","queryIndex","hashIndex","hasBasePath","addBasePath","prefix","addPathPrefix","delBasePath","isLocalURL","url","locationOrigin","resolved","URL","_","interpolateAs","interpolatedRoute","dynamicRegex","getRouteRegex","dynamicGroups","dynamicMatches","asPathname","getRouteMatcher","params","replaced","omitParmsFromQuery","filteredQuery","resolveHref","base","currentPath","urlAsString","formatWithValidation","resolveAs","finalUrl","interpolatedAs","isDynamicRoute","searchParamsToUrlQuery","resolvedHref","stripOrigin","origin","prepareUrlAs","hrefHadOrigin","asHadOrigin","resolvedAs","preparedUrl","preparedAs","as","resolveDynamicRoute","cleanPathname","denormalizePagePath","pages","page","SSG_DATA_NOT_FOUND","fetchRetry","credentials","attempts","data","notFound","fetchNextData","dataHref","isServerRender","Router","constructor","asPath","basePath","components","sdc","sdr","sub","clc","pageLoader","_bps","events","_wrapApp","isSsr","isFallback","_inFlightRoute","_shallow","defaultLocale","domainLocales","isReady","isPreview","isLocaleDomain","_idx","state","parseRelativeUrl","shallow","options","this","Component","initial","props","__N_SSG","initialProps","__N_SSP","autoExportDynamic","change","shouldResolveHref","localeChange","ST","performance","routeProps","cleanedAs","onlyAHashChange","parsed","__rewrites","urlIsNew","method","parsedAs","routeRegex","routeMatch","shouldInterpolate","missingParams","getRouteInfo","routeInfo","destination","parsedHref","newUrl","newAs","fetchComponent","notFoundRoute","isValidShallowRoute","forcedScroll","x","y","getURL","__N","idx","isAssetError","console","handleRouteInfoError","existingRouteInfo","cachedRouteInfo","then","getDataHref","_getData","notify","split","newHash","oldUrlNoHash","oldHash","idEl","nameEl","rewritesResult","_isSsg","isSsg","cancel","loadPage","componentResult","resourceKey","AppTree","ctx","loadGetInitialProps","used","getLocationOrigin","formatUrl","port","getDisplayName","isResSent","App","pageProps","message","SP","decode","decodeURIComponent","slugName","g","m","globalBase","resolvedBase","iterator","_arr","_n","_d","_e","undefined","_s","_i","next","done","push","length","React","RouterContext","_router","instance","coreMethodFields","field","singletonRouter","readyCallbacks","ready","urlPropertyFields","getRouter","routerEvents","event","eventField","_singletonRouter","setPrototypeOf","isNativeReflectConstruct","_construct","Parent","args","Class","a","apply","Function","bind","arguments","isArray","normalizePathSep","replace","startsWith","slice","TypeError","asyncGeneratorStep","gen","_next","_throw","arg","info"],"mappings":"uIAGO,SAAwBA,GAC7B,OAAOC,OAAP,IAHF,IAAMA,EAAN,wB,8ECYe,YAMb,cACE,OAAO,yCAAmBC,QAAQ,IAA3B,cAAP,IAGFC,EAAA,gBAAoCC,EAAkBC,gBAEpDF,EAAD,oBAAkDC,EAAlD,qBACD,EAMA,UAhCF,mBAEA,a,sGCiBO,IAAME,EACM,qBAATC,MAAwBA,KAAhC,qBACA,SAAU,GAGR,I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OJ,EAAIxV,GAAK2V,GAChB7U,EAAQ8U,EAAK9U,MACjB,MAAO6E,GAEP,YADA3B,EAAO2B,GAILiQ,EAAKxC,KACPnQ,EAAQnC,GAERiC,QAAQE,QAAQnC,GAAOwP,KAAKmF,EAAOC,GAwBvCrW,EAAOC,QApBP,SAA2BmG,GACzB,OAAO,WACL,IAAInH,EAAOmP,KACPiH,EAAOM,UACX,OAAO,IAAIjS,SAAQ,SAAUE,EAASe,GACpC,IAAIwR,EAAM/P,EAAGoP,MAAMvW,EAAMoW,GAEzB,SAASe,EAAM3U,GACbyU,EAAmBC,EAAKvS,EAASe,EAAQyR,EAAOC,EAAQ,OAAQ5U,GAGlE,SAAS4U,EAAOhT,GACd6S,EAAmBC,EAAKvS,EAASe,EAAQyR,EAAOC,EAAQ,QAAShT,GAGnE+S,OAAMzC","file":"static/chunks/467e7c2f0c9877ea4ac9d091744c5e890a8875f3.5040de843ee25a31e49a.js","sourcesContent":["// Identify /[param]/ in route string\nconst TEST_ROUTE = /\\/\\[[^/]+?\\](?=\\/|$)/\n\nexport function isDynamicRoute(route: string): boolean {\n return TEST_ROUTE.test(route)\n}\n","import React from 'react'\nimport { NextComponentType, NextPageContext } from '../next-server/lib/utils'\nimport { NextRouter, useRouter } from './router'\n\nexport type WithRouterProps = {\n router: NextRouter\n}\n\nexport type ExcludeRouterProps

= Pick<\n P,\n Exclude\n>\n\nexport default function withRouter<\n P extends WithRouterProps,\n C = NextPageContext\n>(\n ComposedComponent: NextComponentType\n): React.ComponentType> {\n function WithRouterWrapper(props: any): JSX.Element {\n return \n }\n\n WithRouterWrapper.getInitialProps = ComposedComponent.getInitialProps\n // This is needed to allow checking for custom getInitialProps in _app\n ;(WithRouterWrapper as any).origGetInitialProps = (ComposedComponent as any).origGetInitialProps\n if (process.env.NODE_ENV !== 'production') {\n const name =\n ComposedComponent.displayName || ComposedComponent.name || 'Unknown'\n WithRouterWrapper.displayName = `withRouter(${name})`\n }\n\n return WithRouterWrapper\n}\n","type RequestIdleCallbackHandle = any\ntype RequestIdleCallbackOptions = {\n timeout: number\n}\ntype RequestIdleCallbackDeadline = {\n readonly didTimeout: boolean\n timeRemaining: () => number\n}\n\ndeclare global {\n interface Window {\n requestIdleCallback: (\n callback: (deadline: RequestIdleCallbackDeadline) => void,\n opts?: RequestIdleCallbackOptions\n ) => RequestIdleCallbackHandle\n cancelIdleCallback: (id: RequestIdleCallbackHandle) => void\n }\n}\n\nexport const requestIdleCallback =\n (typeof self !== 'undefined' && self.requestIdleCallback) ||\n function (\n cb: (deadline: RequestIdleCallbackDeadline) => void\n ): NodeJS.Timeout {\n let start = Date.now()\n return setTimeout(function () {\n cb({\n didTimeout: false,\n timeRemaining: function () {\n return Math.max(0, 50 - (Date.now() - start))\n },\n })\n }, 1)\n }\n\nexport const cancelIdleCallback =\n (typeof self !== 'undefined' && self.cancelIdleCallback) ||\n function (id: RequestIdleCallbackHandle) {\n return clearTimeout(id)\n }\n","var _typeof = require(\"@babel/runtime/helpers/typeof\");\n\nfunction _getRequireWildcardCache() {\n if (typeof WeakMap !== \"function\") return null;\n var cache = new WeakMap();\n\n _getRequireWildcardCache = function _getRequireWildcardCache() {\n return cache;\n };\n\n return cache;\n}\n\nfunction _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n }\n\n if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") {\n return {\n \"default\": obj\n };\n }\n\n var cache = _getRequireWildcardCache();\n\n if (cache && cache.has(obj)) {\n return cache.get(obj);\n }\n\n var newObj = {};\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n\n if (desc && (desc.get || desc.set)) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n\n newObj[\"default\"] = obj;\n\n if (cache) {\n cache.set(obj, newObj);\n }\n\n return newObj;\n}\n\nmodule.exports = _interopRequireWildcard;","import { ParsedUrlQuery } from 'querystring'\n\nexport function searchParamsToUrlQuery(\n searchParams: URLSearchParams\n): ParsedUrlQuery {\n const query: ParsedUrlQuery = {}\n searchParams.forEach((value, key) => {\n if (typeof query[key] === 'undefined') {\n query[key] = value\n } else if (Array.isArray(query[key])) {\n ;(query[key] as string[]).push(value)\n } else {\n query[key] = [query[key] as string, value]\n }\n })\n return query\n}\n\nfunction stringifyUrlQueryParam(param: string): string {\n if (\n typeof param === 'string' ||\n (typeof param === 'number' && !isNaN(param)) ||\n typeof param === 'boolean'\n ) {\n return String(param)\n } else {\n return ''\n }\n}\n\nexport function urlQueryToSearchParams(\n urlQuery: ParsedUrlQuery\n): URLSearchParams {\n const result = new URLSearchParams()\n Object.entries(urlQuery).forEach(([key, value]) => {\n if (Array.isArray(value)) {\n value.forEach((item) => result.append(key, stringifyUrlQueryParam(item)))\n } else {\n result.set(key, stringifyUrlQueryParam(value))\n }\n })\n return result\n}\n\nexport function assign(\n target: URLSearchParams,\n ...searchParamsList: URLSearchParams[]\n): URLSearchParams {\n searchParamsList.forEach((searchParams) => {\n Array.from(searchParams.keys()).forEach((key) => target.delete(key))\n searchParams.forEach((value, key) => target.append(key, value))\n })\n return target\n}\n","export function normalizeLocalePath(\n pathname: string,\n locales?: string[]\n): {\n detectedLocale?: string\n pathname: string\n} {\n let detectedLocale: string | undefined\n // first item will be empty string from splitting at first char\n const pathnameParts = pathname.split('/')\n\n ;(locales || []).some((locale) => {\n if (pathnameParts[1].toLowerCase() === locale.toLowerCase()) {\n detectedLocale = locale\n pathnameParts.splice(1, 1)\n pathname = pathnameParts.join('/') || '/'\n return true\n }\n return false\n })\n\n return {\n pathname,\n detectedLocale,\n }\n}\n","// Format function modified from nodejs\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nimport { UrlObject } from 'url'\nimport { ParsedUrlQuery } from 'querystring'\nimport * as querystring from './querystring'\n\nconst slashedProtocols = /https?|ftp|gopher|file/\n\nexport function formatUrl(urlObj: UrlObject) {\n let { auth, hostname } = urlObj\n let protocol = urlObj.protocol || ''\n let pathname = urlObj.pathname || ''\n let hash = urlObj.hash || ''\n let query = urlObj.query || ''\n let host: string | false = false\n\n auth = auth ? encodeURIComponent(auth).replace(/%3A/i, ':') + '@' : ''\n\n if (urlObj.host) {\n host = auth + urlObj.host\n } else if (hostname) {\n host = auth + (~hostname.indexOf(':') ? `[${hostname}]` : hostname)\n if (urlObj.port) {\n host += ':' + urlObj.port\n }\n }\n\n if (query && typeof query === 'object') {\n query = String(querystring.urlQueryToSearchParams(query as ParsedUrlQuery))\n }\n\n let search = urlObj.search || (query && `?${query}`) || ''\n\n if (protocol && protocol.substr(-1) !== ':') protocol += ':'\n\n if (\n urlObj.slashes ||\n ((!protocol || slashedProtocols.test(protocol)) && host !== false)\n ) {\n host = '//' + (host || '')\n if (pathname && pathname[0] !== '/') pathname = '/' + pathname\n } else if (!host) {\n host = ''\n }\n\n if (hash && hash[0] !== '#') hash = '#' + hash\n if (search && search[0] !== '?') search = '?' + search\n\n pathname = pathname.replace(/[?#]/g, encodeURIComponent)\n search = search.replace('#', '%23')\n\n return `${protocol}${host}${pathname}${search}${hash}`\n}\n","export default function resolveRewrites() {}\n","var arrayWithHoles = require(\"./arrayWithHoles\");\n\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray\");\n\nvar nonIterableRest = require(\"./nonIterableRest\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;","// Translates a logical route into its pages asset path (relative from a common prefix)\n// \"asset path\" being its javascript file, data file, prerendered html,...\nexport default function getAssetPathFromRoute(\n route: string,\n ext: string = ''\n): string {\n const path =\n route === '/'\n ? '/index'\n : /^\\/index(\\/|$)/.test(route)\n ? `/index${route}`\n : `${route}`\n return path + ext\n}\n","import { ComponentType } from 'react'\nimport { ClientBuildManifest } from '../build/webpack/plugins/build-manifest-plugin'\nimport getAssetPathFromRoute from '../next-server/lib/router/utils/get-asset-path-from-route'\nimport { requestIdleCallback } from './request-idle-callback'\n\n// 3.8s was arbitrarily chosen as it's what https://web.dev/interactive\n// considers as \"Good\" time-to-interactive. We must assume something went\n// wrong beyond this point, and then fall-back to a full page transition to\n// show the user something of value.\nconst MS_MAX_IDLE_DELAY = 3800\n\ndeclare global {\n interface Window {\n __BUILD_MANIFEST?: ClientBuildManifest\n __BUILD_MANIFEST_CB?: Function\n }\n}\n\nexport interface LoadedEntrypointSuccess {\n component: ComponentType\n exports: any\n}\nexport interface LoadedEntrypointFailure {\n error: unknown\n}\nexport type RouteEntrypoint = LoadedEntrypointSuccess | LoadedEntrypointFailure\n\nexport interface RouteStyleSheet {\n href: string\n content: string\n}\n\nexport interface LoadedRouteSuccess extends LoadedEntrypointSuccess {\n styles: RouteStyleSheet[]\n}\nexport interface LoadedRouteFailure {\n error: unknown\n}\nexport type RouteLoaderEntry = LoadedRouteSuccess | LoadedRouteFailure\n\nexport type Future = {\n resolve: (entrypoint: V) => void\n future: Promise\n}\nfunction withFuture(\n key: string,\n map: Map | T>,\n generator?: () => Promise\n): Promise {\n let entry: Future | T | undefined = map.get(key)\n if (entry) {\n if ('future' in entry) {\n return entry.future\n }\n return Promise.resolve(entry)\n }\n let resolver: (entrypoint: T) => void\n const prom: Promise = new Promise((resolve) => {\n resolver = resolve\n })\n map.set(key, (entry = { resolve: resolver!, future: prom }))\n return generator\n ? // eslint-disable-next-line no-sequences\n generator().then((value) => (resolver(value), value))\n : prom\n}\n\nexport interface RouteLoader {\n whenEntrypoint(route: string): Promise\n onEntrypoint(route: string, execute: () => unknown): void\n loadRoute(route: string, prefetch?: boolean): Promise\n prefetch(route: string): Promise\n}\n\nfunction hasPrefetch(link?: HTMLLinkElement): boolean {\n try {\n link = document.createElement('link')\n return (\n // detect IE11 since it supports prefetch but isn't detected\n // with relList.support\n (!!window.MSInputMethodContext && !!(document as any).documentMode) ||\n link.relList.supports('prefetch')\n )\n } catch {\n return false\n }\n}\n\nconst canPrefetch: boolean = hasPrefetch()\n\nfunction prefetchViaDom(\n href: string,\n as: string,\n link?: HTMLLinkElement\n): Promise {\n return new Promise((res, rej) => {\n if (document.querySelector(`link[rel=\"prefetch\"][href^=\"${href}\"]`)) {\n return res()\n }\n\n link = document.createElement('link')\n\n // The order of property assignment here is intentional:\n if (as) link!.as = as\n link!.rel = `prefetch`\n link!.crossOrigin = process.env.__NEXT_CROSS_ORIGIN!\n link!.onload = res\n link!.onerror = rej\n\n // `href` should always be last:\n link!.href = href\n\n document.head.appendChild(link)\n })\n}\n\nconst ASSET_LOAD_ERROR = Symbol('ASSET_LOAD_ERROR')\n// TODO: unexport\nexport function markAssetError(err: Error): Error {\n return Object.defineProperty(err, ASSET_LOAD_ERROR, {})\n}\n\nexport function isAssetError(err?: Error): boolean | undefined {\n return err && ASSET_LOAD_ERROR in err\n}\n\nfunction appendScript(\n src: string,\n script?: HTMLScriptElement\n): Promise {\n return new Promise((resolve, reject) => {\n script = document.createElement('script')\n\n // The order of property assignment here is intentional.\n // 1. Setup success/failure hooks in case the browser synchronously\n // executes when `src` is set.\n script.onload = resolve\n script.onerror = () =>\n reject(markAssetError(new Error(`Failed to load script: ${src}`)))\n\n // 2. Configure the cross-origin attribute before setting `src` in case the\n // browser begins to fetch.\n script.crossOrigin = process.env.__NEXT_CROSS_ORIGIN!\n\n // 3. Finally, set the source and inject into the DOM in case the child\n // must be appended for fetching to start.\n script.src = src\n document.body.appendChild(script)\n })\n}\n\n// Resolve a promise that times out after given amount of milliseconds.\nfunction resolvePromiseWithTimeout(\n p: Promise,\n ms: number,\n err: Error\n): Promise {\n return new Promise((resolve, reject) => {\n let cancelled = false\n\n p.then((r) => {\n // Resolved, cancel the timeout\n cancelled = true\n resolve(r)\n }).catch(reject)\n\n requestIdleCallback(() =>\n setTimeout(() => {\n if (!cancelled) {\n reject(err)\n }\n }, ms)\n )\n })\n}\n\n// TODO: stop exporting or cache the failure\n// It'd be best to stop exporting this. It's an implementation detail. We're\n// only exporting it for backwards compatibilty with the `page-loader`.\n// Only cache this response as a last resort if we cannot eliminate all other\n// code branches that use the Build Manifest Callback and push them through\n// the Route Loader interface.\nexport function getClientBuildManifest(): Promise {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST)\n }\n\n const onBuildManifest: Promise = new Promise<\n ClientBuildManifest\n >((resolve) => {\n // Mandatory because this is not concurrent safe:\n const cb = self.__BUILD_MANIFEST_CB\n self.__BUILD_MANIFEST_CB = () => {\n resolve(self.__BUILD_MANIFEST!)\n cb && cb()\n }\n })\n\n return resolvePromiseWithTimeout(\n onBuildManifest,\n MS_MAX_IDLE_DELAY,\n markAssetError(new Error('Failed to load client build manifest'))\n )\n}\n\ninterface RouteFiles {\n scripts: string[]\n css: string[]\n}\nfunction getFilesForRoute(\n assetPrefix: string,\n route: string\n): Promise {\n if (process.env.NODE_ENV === 'development') {\n return Promise.resolve({\n scripts: [\n assetPrefix +\n '/_next/static/chunks/pages' +\n encodeURI(getAssetPathFromRoute(route, '.js')),\n ],\n // Styles are handled by `style-loader` in development:\n css: [],\n })\n }\n return getClientBuildManifest().then((manifest) => {\n if (!(route in manifest)) {\n throw markAssetError(new Error(`Failed to lookup route: ${route}`))\n }\n const allFiles = manifest[route].map(\n (entry) => assetPrefix + '/_next/' + encodeURI(entry)\n )\n return {\n scripts: allFiles.filter((v) => v.endsWith('.js')),\n css: allFiles.filter((v) => v.endsWith('.css')),\n }\n })\n}\n\nfunction createRouteLoader(assetPrefix: string): RouteLoader {\n const entrypoints: Map<\n string,\n Future | RouteEntrypoint\n > = new Map()\n const loadedScripts: Map> = new Map()\n const styleSheets: Map> = new Map()\n const routes: Map<\n string,\n Future | RouteLoaderEntry\n > = new Map()\n\n function maybeExecuteScript(src: string): Promise {\n let prom: Promise | undefined = loadedScripts.get(src)\n if (prom) {\n return prom\n }\n\n // Skip executing script if it's already in the DOM:\n if (document.querySelector(`script[src^=\"${src}\"]`)) {\n return Promise.resolve()\n }\n\n loadedScripts.set(src, (prom = appendScript(src)))\n return prom\n }\n\n function fetchStyleSheet(href: string): Promise {\n let prom: Promise | undefined = styleSheets.get(href)\n if (prom) {\n return prom\n }\n\n styleSheets.set(\n href,\n (prom = fetch(href)\n .then((res) => {\n if (!res.ok) {\n throw new Error(`Failed to load stylesheet: ${href}`)\n }\n return res.text().then((text) => ({ href: href, content: text }))\n })\n .catch((err) => {\n throw markAssetError(err)\n }))\n )\n return prom\n }\n\n return {\n whenEntrypoint(route: string) {\n return withFuture(route, entrypoints)\n },\n onEntrypoint(route: string, execute: () => unknown) {\n Promise.resolve(execute)\n .then((fn) => fn())\n .then(\n (exports: any) => ({\n component: (exports && exports.default) || exports,\n exports: exports,\n }),\n (err) => ({ error: err })\n )\n .then((input: RouteEntrypoint) => {\n const old = entrypoints.get(route)\n entrypoints.set(route, input)\n if (old && 'resolve' in old) old.resolve(input)\n })\n },\n loadRoute(route: string, prefetch?: boolean) {\n return withFuture(route, routes, () => {\n return resolvePromiseWithTimeout(\n getFilesForRoute(assetPrefix, route)\n .then(({ scripts, css }) => {\n return Promise.all([\n entrypoints.has(route)\n ? []\n : Promise.all(scripts.map(maybeExecuteScript)),\n Promise.all(css.map(fetchStyleSheet)),\n ] as const)\n })\n .then((res) => {\n return this.whenEntrypoint(route).then((entrypoint) => ({\n entrypoint,\n styles: res[1],\n }))\n }),\n MS_MAX_IDLE_DELAY,\n markAssetError(new Error(`Route did not complete loading: ${route}`))\n )\n .then(({ entrypoint, styles }) => {\n const res: RouteLoaderEntry = Object.assign<\n { styles: RouteStyleSheet[] },\n RouteEntrypoint\n >({ styles: styles! }, entrypoint)\n return 'error' in entrypoint ? entrypoint : res\n })\n .catch((err) => {\n if (prefetch) {\n // we don't want to cache errors during prefetch\n throw err\n }\n return { error: err }\n })\n })\n },\n prefetch(route: string): Promise {\n // https://github.com/GoogleChromeLabs/quicklink/blob/453a661fa1fa940e2d2e044452398e38c67a98fb/src/index.mjs#L115-L118\n // License: Apache 2.0\n let cn\n if ((cn = (navigator as any).connection)) {\n // Don't prefetch if using 2G or if Save-Data is enabled.\n if (cn.saveData || /2g/.test(cn.effectiveType)) return Promise.resolve()\n }\n return getFilesForRoute(assetPrefix, route)\n .then((output) =>\n Promise.all(\n canPrefetch\n ? output.scripts.map((script) => prefetchViaDom(script, 'script'))\n : []\n )\n )\n .then(() => {\n requestIdleCallback(() => this.loadRoute(route, true).catch(() => {}))\n })\n .catch(\n // swallow prefetch errors\n () => {}\n )\n },\n }\n}\n\nexport default createRouteLoader\n","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault;","/**\n * Removes the trailing slash of a path if there is one. Preserves the root path `/`.\n */\nexport function removePathTrailingSlash(path: string): string {\n return path.endsWith('/') && path !== '/' ? path.slice(0, -1) : path\n}\n\n/**\n * Normalizes the trailing slash of a path according to the `trailingSlash` option\n * in `next.config.js`.\n */\nexport const normalizePathTrailingSlash = process.env.__NEXT_TRAILING_SLASH\n ? (path: string): string => {\n if (/\\.[^/]+\\/?$/.test(path)) {\n return removePathTrailingSlash(path)\n } else if (path.endsWith('/')) {\n return path\n } else {\n return path + '/'\n }\n }\n : removePathTrailingSlash\n","export interface Group {\n pos: number\n repeat: boolean\n optional: boolean\n}\n\n// this isn't importing the escape-string-regex module\n// to reduce bytes\nfunction escapeRegex(str: string) {\n return str.replace(/[|\\\\{}()[\\]^$+*?.-]/g, '\\\\$&')\n}\n\nfunction parseParameter(param: string) {\n const optional = param.startsWith('[') && param.endsWith(']')\n if (optional) {\n param = param.slice(1, -1)\n }\n const repeat = param.startsWith('...')\n if (repeat) {\n param = param.slice(3)\n }\n return { key: param, repeat, optional }\n}\n\nexport function getRouteRegex(\n normalizedRoute: string\n): {\n re: RegExp\n namedRegex?: string\n routeKeys?: { [named: string]: string }\n groups: { [groupName: string]: Group }\n} {\n const segments = (normalizedRoute.replace(/\\/$/, '') || '/')\n .slice(1)\n .split('/')\n\n const groups: { [groupName: string]: Group } = {}\n let groupIndex = 1\n const parameterizedRoute = segments\n .map((segment) => {\n if (segment.startsWith('[') && segment.endsWith(']')) {\n const { key, optional, repeat } = parseParameter(segment.slice(1, -1))\n groups[key] = { pos: groupIndex++, repeat, optional }\n return repeat ? (optional ? '(?:/(.+?))?' : '/(.+?)') : '/([^/]+?)'\n } else {\n return `/${escapeRegex(segment)}`\n }\n })\n .join('')\n\n // dead code eliminate for browser since it's only needed\n // while generating routes-manifest\n if (typeof window === 'undefined') {\n let routeKeyCharCode = 97\n let routeKeyCharLength = 1\n\n // builds a minimal routeKey using only a-z and minimal number of characters\n const getSafeRouteKey = () => {\n let routeKey = ''\n\n for (let i = 0; i < routeKeyCharLength; i++) {\n routeKey += String.fromCharCode(routeKeyCharCode)\n routeKeyCharCode++\n\n if (routeKeyCharCode > 122) {\n routeKeyCharLength++\n routeKeyCharCode = 97\n }\n }\n return routeKey\n }\n\n const routeKeys: { [named: string]: string } = {}\n\n let namedParameterizedRoute = segments\n .map((segment) => {\n if (segment.startsWith('[') && segment.endsWith(']')) {\n const { key, optional, repeat } = parseParameter(segment.slice(1, -1))\n // replace any non-word characters since they can break\n // the named regex\n let cleanedKey = key.replace(/\\W/g, '')\n let invalidKey = false\n\n // check if the key is still invalid and fallback to using a known\n // safe key\n if (cleanedKey.length === 0 || cleanedKey.length > 30) {\n invalidKey = true\n }\n if (!isNaN(parseInt(cleanedKey.substr(0, 1)))) {\n invalidKey = true\n }\n\n if (invalidKey) {\n cleanedKey = getSafeRouteKey()\n }\n\n routeKeys[cleanedKey] = key\n return repeat\n ? optional\n ? `(?:/(?<${cleanedKey}>.+?))?`\n : `/(?<${cleanedKey}>.+?)`\n : `/(?<${cleanedKey}>[^/]+?)`\n } else {\n return `/${escapeRegex(segment)}`\n }\n })\n .join('')\n\n return {\n re: new RegExp(`^${parameterizedRoute}(?:/)?$`),\n groups,\n routeKeys,\n namedRegex: `^${namedParameterizedRoute}(?:/)?$`,\n }\n }\n\n return {\n re: new RegExp(`^${parameterizedRoute}(?:/)?$`),\n groups,\n }\n}\n","function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nmodule.exports = _isNativeReflectConstruct;","/*\nMIT License\n\nCopyright (c) Jason Miller (https://jasonformat.com/)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n// This file is based on https://github.com/developit/mitt/blob/v1.1.3/src/index.js\n// It's been edited for the needs of this script\n// See the LICENSE at the top of the file\n\ntype Handler = (...evts: any[]) => void\n\nexport type MittEmitter = {\n on(type: string, handler: Handler): void\n off(type: string, handler: Handler): void\n emit(type: string, ...evts: any[]): void\n}\n\nexport default function mitt(): MittEmitter {\n const all: { [s: string]: Handler[] } = Object.create(null)\n\n return {\n on(type: string, handler: Handler) {\n ;(all[type] || (all[type] = [])).push(handler)\n },\n\n off(type: string, handler: Handler) {\n if (all[type]) {\n all[type].splice(all[type].indexOf(handler) >>> 0, 1)\n }\n },\n\n emit(type: string, ...evts: any[]) {\n // eslint-disable-next-line array-callback-return\n ;(all[type] || []).slice().map((handler: Handler) => {\n handler(...evts)\n })\n },\n }\n}\n","// tslint:disable:no-console\nimport { ParsedUrlQuery } from 'querystring'\nimport { ComponentType } from 'react'\nimport { UrlObject } from 'url'\nimport {\n normalizePathTrailingSlash,\n removePathTrailingSlash,\n} from '../../../client/normalize-trailing-slash'\nimport { GoodPageCache, StyleSheetTuple } from '../../../client/page-loader'\nimport {\n getClientBuildManifest,\n isAssetError,\n markAssetError,\n} from '../../../client/route-loader'\nimport { DomainLocales } from '../../server/config'\nimport { denormalizePagePath } from '../../server/denormalize-page-path'\nimport { normalizeLocalePath } from '../i18n/normalize-locale-path'\nimport mitt, { MittEmitter } from '../mitt'\nimport {\n AppContextType,\n formatWithValidation,\n getLocationOrigin,\n getURL,\n loadGetInitialProps,\n NextPageContext,\n ST,\n NEXT_DATA,\n} from '../utils'\nimport { isDynamicRoute } from './utils/is-dynamic'\nimport { parseRelativeUrl } from './utils/parse-relative-url'\nimport { searchParamsToUrlQuery } from './utils/querystring'\nimport resolveRewrites from './utils/resolve-rewrites'\nimport { getRouteMatcher } from './utils/route-matcher'\nimport { getRouteRegex } from './utils/route-regex'\n\ndeclare global {\n interface Window {\n /* prod */\n __NEXT_DATA__: NEXT_DATA\n }\n}\n\ninterface RouteProperties {\n shallow: boolean\n}\n\ninterface TransitionOptions {\n shallow?: boolean\n locale?: string | false\n scroll?: boolean\n}\n\ninterface NextHistoryState {\n url: string\n as: string\n options: TransitionOptions\n}\n\ntype HistoryState =\n | null\n | { __N: false }\n | ({ __N: true; idx: number } & NextHistoryState)\n\nlet detectDomainLocale: typeof import('../i18n/detect-domain-locale').detectDomainLocale\n\nif (process.env.__NEXT_I18N_SUPPORT) {\n detectDomainLocale = require('../i18n/detect-domain-locale')\n .detectDomainLocale\n}\n\nconst basePath = (process.env.__NEXT_ROUTER_BASEPATH as string) || ''\n\nfunction buildCancellationError() {\n return Object.assign(new Error('Route Cancelled'), {\n cancelled: true,\n })\n}\n\nfunction addPathPrefix(path: string, prefix?: string) {\n return prefix && path.startsWith('/')\n ? path === '/'\n ? normalizePathTrailingSlash(prefix)\n : `${prefix}${pathNoQueryHash(path) === '/' ? path.substring(1) : path}`\n : path\n}\n\nexport function getDomainLocale(\n path: string,\n locale?: string | false,\n locales?: string[],\n domainLocales?: DomainLocales\n) {\n if (process.env.__NEXT_I18N_SUPPORT) {\n locale = locale || normalizeLocalePath(path, locales).detectedLocale\n\n const detectedDomain = detectDomainLocale(domainLocales, undefined, locale)\n\n if (detectedDomain) {\n return `http${detectedDomain.http ? '' : 's'}://${detectedDomain.domain}${\n basePath || ''\n }${locale === detectedDomain.defaultLocale ? '' : `/${locale}`}${path}`\n }\n return false\n }\n\n return false\n}\n\nexport function addLocale(\n path: string,\n locale?: string | false,\n defaultLocale?: string\n) {\n if (process.env.__NEXT_I18N_SUPPORT) {\n const pathname = pathNoQueryHash(path)\n const pathLower = pathname.toLowerCase()\n const localeLower = locale && locale.toLowerCase()\n\n return locale &&\n locale !== defaultLocale &&\n !pathLower.startsWith('/' + localeLower + '/') &&\n pathLower !== '/' + localeLower\n ? addPathPrefix(path, '/' + locale)\n : path\n }\n return path\n}\n\nexport function delLocale(path: string, locale?: string) {\n if (process.env.__NEXT_I18N_SUPPORT) {\n const pathname = pathNoQueryHash(path)\n const pathLower = pathname.toLowerCase()\n const localeLower = locale && locale.toLowerCase()\n\n return locale &&\n (pathLower.startsWith('/' + localeLower + '/') ||\n pathLower === '/' + localeLower)\n ? (pathname.length === locale.length + 1 ? '/' : '') +\n path.substr(locale.length + 1)\n : path\n }\n return path\n}\n\nfunction pathNoQueryHash(path: string) {\n const queryIndex = path.indexOf('?')\n const hashIndex = path.indexOf('#')\n\n if (queryIndex > -1 || hashIndex > -1) {\n path = path.substring(0, queryIndex > -1 ? queryIndex : hashIndex)\n }\n return path\n}\n\nexport function hasBasePath(path: string): boolean {\n path = pathNoQueryHash(path)\n return path === basePath || path.startsWith(basePath + '/')\n}\n\nexport function addBasePath(path: string): string {\n // we only add the basepath on relative urls\n return addPathPrefix(path, basePath)\n}\n\nexport function delBasePath(path: string): string {\n path = path.slice(basePath.length)\n if (!path.startsWith('/')) path = `/${path}`\n return path\n}\n\n/**\n * Detects whether a given url is routable by the Next.js router (browser only).\n */\nexport function isLocalURL(url: string): boolean {\n // prevent a hydration mismatch on href for url with anchor refs\n if (url.startsWith('/') || url.startsWith('#')) return true\n try {\n // absolute urls can be local if they are on the same origin\n const locationOrigin = getLocationOrigin()\n const resolved = new URL(url, locationOrigin)\n return resolved.origin === locationOrigin && hasBasePath(resolved.pathname)\n } catch (_) {\n return false\n }\n}\n\ntype Url = UrlObject | string\n\nexport function interpolateAs(\n route: string,\n asPathname: string,\n query: ParsedUrlQuery\n) {\n let interpolatedRoute = ''\n\n const dynamicRegex = getRouteRegex(route)\n const dynamicGroups = dynamicRegex.groups\n const dynamicMatches =\n // Try to match the dynamic route against the asPath\n (asPathname !== route ? getRouteMatcher(dynamicRegex)(asPathname) : '') ||\n // Fall back to reading the values from the href\n // TODO: should this take priority; also need to change in the router.\n query\n\n interpolatedRoute = route\n const params = Object.keys(dynamicGroups)\n\n if (\n !params.every((param) => {\n let value = dynamicMatches[param] || ''\n const { repeat, optional } = dynamicGroups[param]\n\n // support single-level catch-all\n // TODO: more robust handling for user-error (passing `/`)\n let replaced = `[${repeat ? '...' : ''}${param}]`\n if (optional) {\n replaced = `${!value ? '/' : ''}[${replaced}]`\n }\n if (repeat && !Array.isArray(value)) value = [value]\n\n return (\n (optional || param in dynamicMatches) &&\n // Interpolate group into data URL if present\n (interpolatedRoute =\n interpolatedRoute!.replace(\n replaced,\n repeat\n ? (value as string[])\n .map(\n // these values should be fully encoded instead of just\n // path delimiter escaped since they are being inserted\n // into the URL and we expect URL encoded segments\n // when parsing dynamic route params\n (segment) => encodeURIComponent(segment)\n )\n .join('/')\n : encodeURIComponent(value as string)\n ) || '/')\n )\n })\n ) {\n interpolatedRoute = '' // did not satisfy all requirements\n\n // n.b. We ignore this error because we handle warning for this case in\n // development in the `` component directly.\n }\n return {\n params,\n result: interpolatedRoute,\n }\n}\n\nfunction omitParmsFromQuery(query: ParsedUrlQuery, params: string[]) {\n const filteredQuery: ParsedUrlQuery = {}\n\n Object.keys(query).forEach((key) => {\n if (!params.includes(key)) {\n filteredQuery[key] = query[key]\n }\n })\n return filteredQuery\n}\n\n/**\n * Resolves a given hyperlink with a certain router state (basePath not included).\n * Preserves absolute urls.\n */\nexport function resolveHref(\n currentPath: string,\n href: Url,\n resolveAs?: boolean\n): string {\n // we use a dummy base url for relative urls\n let base: URL\n\n try {\n base = new URL(currentPath, 'http://n')\n } catch (_) {\n // fallback to / for invalid asPath values e.g. //\n base = new URL('/', 'http://n')\n }\n const urlAsString =\n typeof href === 'string' ? href : formatWithValidation(href)\n // Return because it cannot be routed by the Next.js router\n if (!isLocalURL(urlAsString)) {\n return (resolveAs ? [urlAsString] : urlAsString) as string\n }\n try {\n const finalUrl = new URL(urlAsString, base)\n finalUrl.pathname = normalizePathTrailingSlash(finalUrl.pathname)\n let interpolatedAs = ''\n\n if (\n isDynamicRoute(finalUrl.pathname) &&\n finalUrl.searchParams &&\n resolveAs\n ) {\n const query = searchParamsToUrlQuery(finalUrl.searchParams)\n\n const { result, params } = interpolateAs(\n finalUrl.pathname,\n finalUrl.pathname,\n query\n )\n\n if (result) {\n interpolatedAs = formatWithValidation({\n pathname: result,\n hash: finalUrl.hash,\n query: omitParmsFromQuery(query, params),\n })\n }\n }\n\n // if the origin didn't change, it means we received a relative href\n const resolvedHref =\n finalUrl.origin === base.origin\n ? finalUrl.href.slice(finalUrl.origin.length)\n : finalUrl.href\n\n return (resolveAs\n ? [resolvedHref, interpolatedAs || resolvedHref]\n : resolvedHref) as string\n } catch (_) {\n return (resolveAs ? [urlAsString] : urlAsString) as string\n }\n}\n\nfunction stripOrigin(url: string) {\n const origin = getLocationOrigin()\n\n return url.startsWith(origin) ? url.substring(origin.length) : url\n}\n\nfunction prepareUrlAs(router: NextRouter, url: Url, as?: Url) {\n // If url and as provided as an object representation,\n // we'll format them into the string version here.\n let [resolvedHref, resolvedAs] = resolveHref(router.asPath, url, true)\n const origin = getLocationOrigin()\n const hrefHadOrigin = resolvedHref.startsWith(origin)\n const asHadOrigin = resolvedAs && resolvedAs.startsWith(origin)\n\n resolvedHref = stripOrigin(resolvedHref)\n resolvedAs = resolvedAs ? stripOrigin(resolvedAs) : resolvedAs\n\n const preparedUrl = hrefHadOrigin ? resolvedHref : addBasePath(resolvedHref)\n const preparedAs = as\n ? stripOrigin(resolveHref(router.asPath, as))\n : resolvedAs || resolvedHref\n\n return {\n url: preparedUrl,\n as: asHadOrigin ? preparedAs : addBasePath(preparedAs),\n }\n}\n\nfunction resolveDynamicRoute(pathname: string, pages: string[]) {\n const cleanPathname = removePathTrailingSlash(denormalizePagePath(pathname!))\n\n if (cleanPathname === '/404' || cleanPathname === '/_error') {\n return pathname\n }\n\n // handle resolving href for dynamic routes\n if (!pages.includes(cleanPathname!)) {\n // eslint-disable-next-line array-callback-return\n pages.some((page) => {\n if (isDynamicRoute(page) && getRouteRegex(page).re.test(cleanPathname!)) {\n pathname = page\n return true\n }\n })\n }\n return removePathTrailingSlash(pathname)\n}\n\nexport type BaseRouter = {\n route: string\n pathname: string\n query: ParsedUrlQuery\n asPath: string\n basePath: string\n locale?: string\n locales?: string[]\n defaultLocale?: string\n domainLocales?: DomainLocales\n isLocaleDomain: boolean\n}\n\nexport type NextRouter = BaseRouter &\n Pick<\n Router,\n | 'push'\n | 'replace'\n | 'reload'\n | 'back'\n | 'prefetch'\n | 'beforePopState'\n | 'events'\n | 'isFallback'\n | 'isReady'\n | 'isPreview'\n >\n\nexport type PrefetchOptions = {\n priority?: boolean\n locale?: string | false\n}\n\nexport type PrivateRouteInfo =\n | (Omit & { initial: true })\n | CompletePrivateRouteInfo\n\nexport type CompletePrivateRouteInfo = {\n Component: ComponentType\n styleSheets: StyleSheetTuple[]\n __N_SSG?: boolean\n __N_SSP?: boolean\n props?: Record\n err?: Error\n error?: any\n}\n\nexport type AppProps = Pick & {\n router: Router\n} & Record\nexport type AppComponent = ComponentType\n\ntype Subscription = (\n data: PrivateRouteInfo,\n App: AppComponent,\n resetScroll: { x: number; y: number } | null\n) => Promise\n\ntype BeforePopStateCallback = (state: NextHistoryState) => boolean\n\ntype ComponentLoadCancel = (() => void) | null\n\ntype HistoryMethod = 'replaceState' | 'pushState'\n\nconst manualScrollRestoration =\n process.env.__NEXT_SCROLL_RESTORATION &&\n typeof window !== 'undefined' &&\n 'scrollRestoration' in window.history &&\n !!(function () {\n try {\n let v = '__next'\n // eslint-disable-next-line no-sequences\n return sessionStorage.setItem(v, v), sessionStorage.removeItem(v), true\n } catch (n) {}\n })()\n\nconst SSG_DATA_NOT_FOUND = Symbol('SSG_DATA_NOT_FOUND')\n\nfunction fetchRetry(url: string, attempts: number): Promise {\n return fetch(url, {\n // Cookies are required to be present for Next.js' SSG \"Preview Mode\".\n // Cookies may also be required for `getServerSideProps`.\n //\n // > `fetch` won’t send cookies, unless you set the credentials init\n // > option.\n // https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch\n //\n // > For maximum browser compatibility when it comes to sending &\n // > receiving cookies, always supply the `credentials: 'same-origin'`\n // > option instead of relying on the default.\n // https://github.com/github/fetch#caveats\n credentials: 'same-origin',\n }).then((res) => {\n if (!res.ok) {\n if (attempts > 1 && res.status >= 500) {\n return fetchRetry(url, attempts - 1)\n }\n if (res.status === 404) {\n return res.json().then((data) => {\n if (data.notFound) {\n return { notFound: SSG_DATA_NOT_FOUND }\n }\n throw new Error(`Failed to load static props`)\n })\n }\n throw new Error(`Failed to load static props`)\n }\n return res.json()\n })\n}\n\nfunction fetchNextData(dataHref: string, isServerRender: boolean) {\n return fetchRetry(dataHref, isServerRender ? 3 : 1).catch((err: Error) => {\n // We should only trigger a server-side transition if this was caused\n // on a client-side transition. Otherwise, we'd get into an infinite\n // loop.\n\n if (!isServerRender) {\n markAssetError(err)\n }\n throw err\n })\n}\n\nexport default class Router implements BaseRouter {\n route: string\n pathname: string\n query: ParsedUrlQuery\n asPath: string\n basePath: string\n\n /**\n * Map of all components loaded in `Router`\n */\n components: { [pathname: string]: PrivateRouteInfo }\n // Static Data Cache\n sdc: { [asPath: string]: object } = {}\n // In-flight Server Data Requests, for deduping\n sdr: { [asPath: string]: Promise } = {}\n\n sub: Subscription\n clc: ComponentLoadCancel\n pageLoader: any\n _bps: BeforePopStateCallback | undefined\n events: MittEmitter\n _wrapApp: (App: AppComponent) => any\n isSsr: boolean\n isFallback: boolean\n _inFlightRoute?: string\n _shallow?: boolean\n locale?: string\n locales?: string[]\n defaultLocale?: string\n domainLocales?: DomainLocales\n isReady: boolean\n isPreview: boolean\n isLocaleDomain: boolean\n\n private _idx: number = 0\n\n static events: MittEmitter = mitt()\n\n constructor(\n pathname: string,\n query: ParsedUrlQuery,\n as: string,\n {\n initialProps,\n pageLoader,\n App,\n wrapApp,\n Component,\n err,\n subscription,\n isFallback,\n locale,\n locales,\n defaultLocale,\n domainLocales,\n isPreview,\n }: {\n subscription: Subscription\n initialProps: any\n pageLoader: any\n Component: ComponentType\n App: AppComponent\n wrapApp: (WrapAppComponent: AppComponent) => any\n err?: Error\n isFallback: boolean\n locale?: string\n locales?: string[]\n defaultLocale?: string\n domainLocales?: DomainLocales\n isPreview?: boolean\n }\n ) {\n // represents the current component key\n this.route = removePathTrailingSlash(pathname)\n\n // set up the component cache (by route keys)\n this.components = {}\n // We should not keep the cache, if there's an error\n // Otherwise, this cause issues when when going back and\n // come again to the errored page.\n if (pathname !== '/_error') {\n this.components[this.route] = {\n Component,\n initial: true,\n props: initialProps,\n err,\n __N_SSG: initialProps && initialProps.__N_SSG,\n __N_SSP: initialProps && initialProps.__N_SSP,\n }\n }\n\n this.components['/_app'] = {\n Component: App as ComponentType,\n styleSheets: [\n /* /_app does not need its stylesheets managed */\n ],\n }\n\n // Backwards compat for Router.router.events\n // TODO: Should be remove the following major version as it was never documented\n this.events = Router.events\n\n this.pageLoader = pageLoader\n this.pathname = pathname\n this.query = query\n // if auto prerendered and dynamic route wait to update asPath\n // until after mount to prevent hydration mismatch\n const autoExportDynamic =\n isDynamicRoute(pathname) && self.__NEXT_DATA__.autoExport\n\n this.asPath = autoExportDynamic ? pathname : as\n this.basePath = basePath\n this.sub = subscription\n this.clc = null\n this._wrapApp = wrapApp\n // make sure to ignore extra popState in safari on navigating\n // back from external site\n this.isSsr = true\n\n this.isFallback = isFallback\n\n this.isReady = !!(\n self.__NEXT_DATA__.gssp ||\n self.__NEXT_DATA__.gip ||\n (!autoExportDynamic &&\n !self.location.search &&\n !process.env.__NEXT_HAS_REWRITES)\n )\n this.isPreview = !!isPreview\n this.isLocaleDomain = false\n\n if (process.env.__NEXT_I18N_SUPPORT) {\n this.locale = locale\n this.locales = locales\n this.defaultLocale = defaultLocale\n this.domainLocales = domainLocales\n this.isLocaleDomain = !!detectDomainLocale(\n domainLocales,\n self.location.hostname\n )\n }\n\n if (typeof window !== 'undefined') {\n // make sure \"as\" doesn't start with double slashes or else it can\n // throw an error as it's considered invalid\n if (as.substr(0, 2) !== '//') {\n // in order for `e.state` to work on the `onpopstate` event\n // we have to register the initial route upon initialization\n this.changeState(\n 'replaceState',\n formatWithValidation({ pathname: addBasePath(pathname), query }),\n getURL(),\n { locale }\n )\n }\n\n window.addEventListener('popstate', this.onPopState)\n\n // enable custom scroll restoration handling when available\n // otherwise fallback to browser's default handling\n if (process.env.__NEXT_SCROLL_RESTORATION) {\n if (manualScrollRestoration) {\n window.history.scrollRestoration = 'manual'\n }\n }\n }\n }\n\n onPopState = (e: PopStateEvent): void => {\n const state = e.state as HistoryState\n\n if (!state) {\n // We get state as undefined for two reasons.\n // 1. With older safari (< 8) and older chrome (< 34)\n // 2. When the URL changed with #\n //\n // In the both cases, we don't need to proceed and change the route.\n // (as it's already changed)\n // But we can simply replace the state with the new changes.\n // Actually, for (1) we don't need to nothing. But it's hard to detect that event.\n // So, doing the following for (1) does no harm.\n const { pathname, query } = this\n this.changeState(\n 'replaceState',\n formatWithValidation({ pathname: addBasePath(pathname), query }),\n getURL()\n )\n return\n }\n\n if (!state.__N) {\n return\n }\n\n let forcedScroll: { x: number; y: number } | undefined\n const { url, as, options, idx } = state\n if (process.env.__NEXT_SCROLL_RESTORATION) {\n if (manualScrollRestoration) {\n if (this._idx !== idx) {\n // Snapshot current scroll position:\n try {\n sessionStorage.setItem(\n '__next_scroll_' + this._idx,\n JSON.stringify({ x: self.pageXOffset, y: self.pageYOffset })\n )\n } catch {}\n\n // Restore old scroll position:\n try {\n const v = sessionStorage.getItem('__next_scroll_' + idx)\n forcedScroll = JSON.parse(v!)\n } catch {\n forcedScroll = { x: 0, y: 0 }\n }\n }\n }\n }\n this._idx = idx\n\n const { pathname } = parseRelativeUrl(url)\n\n // Make sure we don't re-render on initial load,\n // can be caused by navigating back from an external site\n if (this.isSsr && as === this.asPath && pathname === this.pathname) {\n return\n }\n\n // If the downstream application returns falsy, return.\n // They will then be responsible for handling the event.\n if (this._bps && !this._bps(state)) {\n return\n }\n\n this.change(\n 'replaceState',\n url,\n as,\n Object.assign<{}, TransitionOptions, TransitionOptions>({}, options, {\n shallow: options.shallow && this._shallow,\n locale: options.locale || this.defaultLocale,\n }),\n forcedScroll\n )\n }\n\n reload(): void {\n window.location.reload()\n }\n\n /**\n * Go back in history\n */\n back() {\n window.history.back()\n }\n\n /**\n * Performs a `pushState` with arguments\n * @param url of the route\n * @param as masks `url` for the browser\n * @param options object you can define `shallow` and other options\n */\n push(url: Url, as?: Url, options: TransitionOptions = {}) {\n if (process.env.__NEXT_SCROLL_RESTORATION) {\n // TODO: remove in the future when we update history before route change\n // is complete, as the popstate event should handle this capture.\n if (manualScrollRestoration) {\n try {\n // Snapshot scroll position right before navigating to a new page:\n sessionStorage.setItem(\n '__next_scroll_' + this._idx,\n JSON.stringify({ x: self.pageXOffset, y: self.pageYOffset })\n )\n } catch {}\n }\n }\n ;({ url, as } = prepareUrlAs(this, url, as))\n return this.change('pushState', url, as, options)\n }\n\n /**\n * Performs a `replaceState` with arguments\n * @param url of the route\n * @param as masks `url` for the browser\n * @param options object you can define `shallow` and other options\n */\n replace(url: Url, as?: Url, options: TransitionOptions = {}) {\n ;({ url, as } = prepareUrlAs(this, url, as))\n return this.change('replaceState', url, as, options)\n }\n\n private async change(\n method: HistoryMethod,\n url: string,\n as: string,\n options: TransitionOptions,\n forcedScroll?: { x: number; y: number }\n ): Promise {\n if (!isLocalURL(url)) {\n window.location.href = url\n return false\n }\n const shouldResolveHref = url === as || (options as any)._h\n\n // for static pages with query params in the URL we delay\n // marking the router ready until after the query is updated\n if ((options as any)._h) {\n this.isReady = true\n }\n\n // Default to scroll reset behavior unless explicitly specified to be\n // `false`! This makes the behavior between using `Router#push` and a\n // `` consistent.\n options.scroll = !!(options.scroll ?? true)\n\n let localeChange = options.locale !== this.locale\n\n if (process.env.__NEXT_I18N_SUPPORT) {\n this.locale =\n options.locale === false\n ? this.defaultLocale\n : options.locale || this.locale\n\n if (typeof options.locale === 'undefined') {\n options.locale = this.locale\n }\n\n const parsedAs = parseRelativeUrl(hasBasePath(as) ? delBasePath(as) : as)\n const localePathResult = normalizeLocalePath(\n parsedAs.pathname,\n this.locales\n )\n\n if (localePathResult.detectedLocale) {\n this.locale = localePathResult.detectedLocale\n parsedAs.pathname = addBasePath(parsedAs.pathname)\n as = formatWithValidation(parsedAs)\n url = addBasePath(\n normalizeLocalePath(\n hasBasePath(url) ? delBasePath(url) : url,\n this.locales\n ).pathname\n )\n }\n let didNavigate = false\n\n // we need to wrap this in the env check again since regenerator runtime\n // moves this on its own due to the return\n if (process.env.__NEXT_I18N_SUPPORT) {\n // if the locale isn't configured hard navigate to show 404 page\n if (!this.locales?.includes(this.locale!)) {\n parsedAs.pathname = addLocale(parsedAs.pathname, this.locale)\n window.location.href = formatWithValidation(parsedAs)\n // this was previously a return but was removed in favor\n // of better dead code elimination with regenerator runtime\n didNavigate = true\n }\n }\n\n const detectedDomain = detectDomainLocale(\n this.domainLocales,\n undefined,\n this.locale\n )\n\n // we need to wrap this in the env check again since regenerator runtime\n // moves this on its own due to the return\n if (process.env.__NEXT_I18N_SUPPORT) {\n // if we are navigating to a domain locale ensure we redirect to the\n // correct domain\n if (\n !didNavigate &&\n detectedDomain &&\n this.isLocaleDomain &&\n self.location.hostname !== detectedDomain.domain\n ) {\n const asNoBasePath = delBasePath(as)\n window.location.href = `http${detectedDomain.http ? '' : 's'}://${\n detectedDomain.domain\n }${addBasePath(\n `${\n this.locale === detectedDomain.defaultLocale\n ? ''\n : `/${this.locale}`\n }${asNoBasePath === '/' ? '' : asNoBasePath}` || '/'\n )}`\n // this was previously a return but was removed in favor\n // of better dead code elimination with regenerator runtime\n didNavigate = true\n }\n }\n\n if (didNavigate) {\n return new Promise(() => {})\n }\n }\n\n if (!(options as any)._h) {\n this.isSsr = false\n }\n // marking route changes as a navigation start entry\n if (ST) {\n performance.mark('routeChange')\n }\n\n const { shallow = false } = options\n const routeProps = { shallow }\n\n if (this._inFlightRoute) {\n this.abortComponentLoad(this._inFlightRoute, routeProps)\n }\n\n as = addBasePath(\n addLocale(\n hasBasePath(as) ? delBasePath(as) : as,\n options.locale,\n this.defaultLocale\n )\n )\n const cleanedAs = delLocale(\n hasBasePath(as) ? delBasePath(as) : as,\n this.locale\n )\n this._inFlightRoute = as\n\n // If the url change is only related to a hash change\n // We should not proceed. We should only change the state.\n\n // WARNING: `_h` is an internal option for handing Next.js client-side\n // hydration. Your app should _never_ use this property. It may change at\n // any time without notice.\n if (!(options as any)._h && this.onlyAHashChange(cleanedAs)) {\n this.asPath = cleanedAs\n Router.events.emit('hashChangeStart', as, routeProps)\n // TODO: do we need the resolved href when only a hash change?\n this.changeState(method, url, as, options)\n this.scrollToHash(cleanedAs)\n this.notify(this.components[this.route], null)\n Router.events.emit('hashChangeComplete', as, routeProps)\n return true\n }\n\n let parsed = parseRelativeUrl(url)\n let { pathname, query } = parsed\n\n // The build manifest needs to be loaded before auto-static dynamic pages\n // get their query parameters to allow ensuring they can be parsed properly\n // when rewritten to\n let pages: any, rewrites: any\n try {\n pages = await this.pageLoader.getPageList()\n ;({ __rewrites: rewrites } = await getClientBuildManifest())\n } catch (err) {\n // If we fail to resolve the page list or client-build manifest, we must\n // do a server-side transition:\n window.location.href = as\n return false\n }\n\n // If asked to change the current URL we should reload the current page\n // (not location.reload() but reload getInitialProps and other Next.js stuffs)\n // We also need to set the method = replaceState always\n // as this should not go into the history (That's how browsers work)\n // We should compare the new asPath to the current asPath, not the url\n if (!this.urlIsNew(cleanedAs) && !localeChange) {\n method = 'replaceState'\n }\n\n // we need to resolve the as value using rewrites for dynamic SSG\n // pages to allow building the data URL correctly\n let resolvedAs = as\n\n // url and as should always be prefixed with basePath by this\n // point by either next/link or router.push/replace so strip the\n // basePath from the pathname to match the pages dir 1-to-1\n pathname = pathname\n ? removePathTrailingSlash(delBasePath(pathname))\n : pathname\n\n if (shouldResolveHref && pathname !== '/_error') {\n if (process.env.__NEXT_HAS_REWRITES && as.startsWith('/')) {\n const rewritesResult = resolveRewrites(\n addBasePath(addLocale(cleanedAs, this.locale)),\n pages,\n rewrites,\n query,\n (p: string) => resolveDynamicRoute(p, pages),\n this.locales\n )\n resolvedAs = rewritesResult.asPath\n\n if (rewritesResult.matchedPage && rewritesResult.resolvedHref) {\n // if this directly matches a page we need to update the href to\n // allow the correct page chunk to be loaded\n pathname = rewritesResult.resolvedHref\n parsed.pathname = pathname\n url = formatWithValidation(parsed)\n }\n } else {\n parsed.pathname = resolveDynamicRoute(pathname, pages)\n\n if (parsed.pathname !== pathname) {\n pathname = parsed.pathname\n url = formatWithValidation(parsed)\n }\n }\n }\n\n const route = removePathTrailingSlash(pathname)\n\n if (!isLocalURL(as)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `Invalid href: \"${url}\" and as: \"${as}\", received relative href and external as` +\n `\\nSee more info: https://nextjs.org/docs/messages/invalid-relative-url-external-as`\n )\n }\n\n window.location.href = as\n return false\n }\n\n resolvedAs = delLocale(delBasePath(resolvedAs), this.locale)\n\n if (isDynamicRoute(route)) {\n const parsedAs = parseRelativeUrl(resolvedAs)\n const asPathname = parsedAs.pathname\n\n const routeRegex = getRouteRegex(route)\n const routeMatch = getRouteMatcher(routeRegex)(asPathname)\n const shouldInterpolate = route === asPathname\n const interpolatedAs = shouldInterpolate\n ? interpolateAs(route, asPathname, query)\n : ({} as { result: undefined; params: undefined })\n\n if (!routeMatch || (shouldInterpolate && !interpolatedAs.result)) {\n const missingParams = Object.keys(routeRegex.groups).filter(\n (param) => !query[param]\n )\n\n if (missingParams.length > 0) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `${\n shouldInterpolate\n ? `Interpolating href`\n : `Mismatching \\`as\\` and \\`href\\``\n } failed to manually provide ` +\n `the params: ${missingParams.join(\n ', '\n )} in the \\`href\\`'s \\`query\\``\n )\n }\n\n throw new Error(\n (shouldInterpolate\n ? `The provided \\`href\\` (${url}) value is missing query values (${missingParams.join(\n ', '\n )}) to be interpolated properly. `\n : `The provided \\`as\\` value (${asPathname}) is incompatible with the \\`href\\` value (${route}). `) +\n `Read more: https://nextjs.org/docs/messages/${\n shouldInterpolate\n ? 'href-interpolation-failed'\n : 'incompatible-href-as'\n }`\n )\n }\n } else if (shouldInterpolate) {\n as = formatWithValidation(\n Object.assign({}, parsedAs, {\n pathname: interpolatedAs.result,\n query: omitParmsFromQuery(query, interpolatedAs.params!),\n })\n )\n } else {\n // Merge params into `query`, overwriting any specified in search\n Object.assign(query, routeMatch)\n }\n }\n\n Router.events.emit('routeChangeStart', as, routeProps)\n\n try {\n let routeInfo = await this.getRouteInfo(\n route,\n pathname,\n query,\n as,\n resolvedAs,\n routeProps\n )\n let { error, props, __N_SSG, __N_SSP } = routeInfo\n\n // handle redirect on client-transition\n if ((__N_SSG || __N_SSP) && props) {\n if ((props as any).pageProps && (props as any).pageProps.__N_REDIRECT) {\n const destination = (props as any).pageProps.__N_REDIRECT\n\n // check if destination is internal (resolves to a page) and attempt\n // client-navigation if it is falling back to hard navigation if\n // it's not\n if (destination.startsWith('/')) {\n const parsedHref = parseRelativeUrl(destination)\n parsedHref.pathname = resolveDynamicRoute(\n parsedHref.pathname,\n pages\n )\n\n if (pages.includes(parsedHref.pathname)) {\n const { url: newUrl, as: newAs } = prepareUrlAs(\n this,\n destination,\n destination\n )\n return this.change(method, newUrl, newAs, options)\n }\n }\n\n window.location.href = destination\n return new Promise(() => {})\n }\n\n this.isPreview = !!props.__N_PREVIEW\n\n // handle SSG data 404\n if (props.notFound === SSG_DATA_NOT_FOUND) {\n let notFoundRoute\n\n try {\n await this.fetchComponent('/404')\n notFoundRoute = '/404'\n } catch (_) {\n notFoundRoute = '/_error'\n }\n\n routeInfo = await this.getRouteInfo(\n notFoundRoute,\n notFoundRoute,\n query,\n as,\n resolvedAs,\n { shallow: false }\n )\n }\n }\n\n Router.events.emit('beforeHistoryChange', as, routeProps)\n this.changeState(method, url, as, options)\n\n if (process.env.NODE_ENV !== 'production') {\n const appComp: any = this.components['/_app'].Component\n ;(window as any).next.isPrerendered =\n appComp.getInitialProps === appComp.origGetInitialProps &&\n !(routeInfo.Component as any).getInitialProps\n }\n\n // shallow routing is only allowed for same page URL changes.\n const isValidShallowRoute = options.shallow && this.route === route\n\n if (\n (options as any)._h &&\n pathname === '/_error' &&\n self.__NEXT_DATA__.props?.pageProps?.statusCode === 500 &&\n props?.pageProps\n ) {\n // ensure statusCode is still correct for static 500 page\n // when updating query information\n props.pageProps.statusCode = 500\n }\n\n await this.set(\n route,\n pathname!,\n query,\n cleanedAs,\n routeInfo,\n forcedScroll ||\n (isValidShallowRoute || !options.scroll ? null : { x: 0, y: 0 })\n ).catch((e) => {\n if (e.cancelled) error = error || e\n else throw e\n })\n\n if (error) {\n Router.events.emit('routeChangeError', error, cleanedAs, routeProps)\n throw error\n }\n\n if (process.env.__NEXT_I18N_SUPPORT) {\n if (this.locale) {\n document.documentElement.lang = this.locale\n }\n }\n Router.events.emit('routeChangeComplete', as, routeProps)\n\n return true\n } catch (err) {\n if (err.cancelled) {\n return false\n }\n throw err\n }\n }\n\n changeState(\n method: HistoryMethod,\n url: string,\n as: string,\n options: TransitionOptions = {}\n ): void {\n if (process.env.NODE_ENV !== 'production') {\n if (typeof window.history === 'undefined') {\n console.error(`Warning: window.history is not available.`)\n return\n }\n\n if (typeof window.history[method] === 'undefined') {\n console.error(`Warning: window.history.${method} is not available`)\n return\n }\n }\n\n if (method !== 'pushState' || getURL() !== as) {\n this._shallow = options.shallow\n window.history[method](\n {\n url,\n as,\n options,\n __N: true,\n idx: this._idx = method !== 'pushState' ? this._idx : this._idx + 1,\n } as HistoryState,\n // Most browsers currently ignores this parameter, although they may use it in the future.\n // Passing the empty string here should be safe against future changes to the method.\n // https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState\n '',\n as\n )\n }\n }\n\n async handleRouteInfoError(\n err: Error & { code: any; cancelled: boolean },\n pathname: string,\n query: ParsedUrlQuery,\n as: string,\n routeProps: RouteProperties,\n loadErrorFail?: boolean\n ): Promise {\n if (err.cancelled) {\n // bubble up cancellation errors\n throw err\n }\n\n if (isAssetError(err) || loadErrorFail) {\n Router.events.emit('routeChangeError', err, as, routeProps)\n\n // If we can't load the page it could be one of following reasons\n // 1. Page doesn't exists\n // 2. Page does exist in a different zone\n // 3. Internal error while loading the page\n\n // So, doing a hard reload is the proper way to deal with this.\n window.location.href = as\n\n // Changing the URL doesn't block executing the current code path.\n // So let's throw a cancellation error stop the routing logic.\n throw buildCancellationError()\n }\n\n try {\n let Component: ComponentType\n let styleSheets: StyleSheetTuple[]\n let props: Record | undefined\n\n if (\n typeof Component! === 'undefined' ||\n typeof styleSheets! === 'undefined'\n ) {\n ;({ page: Component, styleSheets } = await this.fetchComponent(\n '/_error'\n ))\n }\n\n const routeInfo: CompletePrivateRouteInfo = {\n props,\n Component,\n styleSheets,\n err,\n error: err,\n }\n\n if (!routeInfo.props) {\n try {\n routeInfo.props = await this.getInitialProps(Component, {\n err,\n pathname,\n query,\n } as any)\n } catch (gipErr) {\n console.error('Error in error page `getInitialProps`: ', gipErr)\n routeInfo.props = {}\n }\n }\n\n return routeInfo\n } catch (routeInfoErr) {\n return this.handleRouteInfoError(\n routeInfoErr,\n pathname,\n query,\n as,\n routeProps,\n true\n )\n }\n }\n\n async getRouteInfo(\n route: string,\n pathname: string,\n query: any,\n as: string,\n resolvedAs: string,\n routeProps: RouteProperties\n ): Promise {\n try {\n const existingRouteInfo: PrivateRouteInfo | undefined = this.components[\n route\n ]\n if (routeProps.shallow && existingRouteInfo && this.route === route) {\n return existingRouteInfo\n }\n\n const cachedRouteInfo: CompletePrivateRouteInfo | undefined =\n existingRouteInfo && 'initial' in existingRouteInfo\n ? undefined\n : existingRouteInfo\n const routeInfo: CompletePrivateRouteInfo = cachedRouteInfo\n ? cachedRouteInfo\n : await this.fetchComponent(route).then((res) => ({\n Component: res.page,\n styleSheets: res.styleSheets,\n __N_SSG: res.mod.__N_SSG,\n __N_SSP: res.mod.__N_SSP,\n }))\n\n const { Component, __N_SSG, __N_SSP } = routeInfo\n\n if (process.env.NODE_ENV !== 'production') {\n const { isValidElementType } = require('react-is')\n if (!isValidElementType(Component)) {\n throw new Error(\n `The default export is not a React Component in page: \"${pathname}\"`\n )\n }\n }\n\n let dataHref: string | undefined\n\n if (__N_SSG || __N_SSP) {\n dataHref = this.pageLoader.getDataHref(\n formatWithValidation({ pathname, query }),\n resolvedAs,\n __N_SSG,\n this.locale\n )\n }\n\n const props = await this._getData(() =>\n __N_SSG\n ? this._getStaticData(dataHref!)\n : __N_SSP\n ? this._getServerData(dataHref!)\n : this.getInitialProps(\n Component,\n // we provide AppTree later so this needs to be `any`\n {\n pathname,\n query,\n asPath: as,\n locale: this.locale,\n locales: this.locales,\n defaultLocale: this.defaultLocale,\n } as any\n )\n )\n\n routeInfo.props = props\n this.components[route] = routeInfo\n return routeInfo\n } catch (err) {\n return this.handleRouteInfoError(err, pathname, query, as, routeProps)\n }\n }\n\n set(\n route: string,\n pathname: string,\n query: ParsedUrlQuery,\n as: string,\n data: PrivateRouteInfo,\n resetScroll: { x: number; y: number } | null\n ): Promise {\n this.isFallback = false\n\n this.route = route\n this.pathname = pathname\n this.query = query\n this.asPath = as\n return this.notify(data, resetScroll)\n }\n\n /**\n * Callback to execute before replacing router state\n * @param cb callback to be executed\n */\n beforePopState(cb: BeforePopStateCallback) {\n this._bps = cb\n }\n\n onlyAHashChange(as: string): boolean {\n if (!this.asPath) return false\n const [oldUrlNoHash, oldHash] = this.asPath.split('#')\n const [newUrlNoHash, newHash] = as.split('#')\n\n // Makes sure we scroll to the provided hash if the url/hash are the same\n if (newHash && oldUrlNoHash === newUrlNoHash && oldHash === newHash) {\n return true\n }\n\n // If the urls are change, there's more than a hash change\n if (oldUrlNoHash !== newUrlNoHash) {\n return false\n }\n\n // If the hash has changed, then it's a hash only change.\n // This check is necessary to handle both the enter and\n // leave hash === '' cases. The identity case falls through\n // and is treated as a next reload.\n return oldHash !== newHash\n }\n\n scrollToHash(as: string): void {\n const [, hash] = as.split('#')\n // Scroll to top if the hash is just `#` with no value or `#top`\n // To mirror browsers\n if (hash === '' || hash === 'top') {\n window.scrollTo(0, 0)\n return\n }\n\n // First we check if the element by id is found\n const idEl = document.getElementById(hash)\n if (idEl) {\n idEl.scrollIntoView()\n return\n }\n // If there's no element with the id, we check the `name` property\n // To mirror browsers\n const nameEl = document.getElementsByName(hash)[0]\n if (nameEl) {\n nameEl.scrollIntoView()\n }\n }\n\n urlIsNew(asPath: string): boolean {\n return this.asPath !== asPath\n }\n\n /**\n * Prefetch page code, you may wait for the data during page rendering.\n * This feature only works in production!\n * @param url the href of prefetched page\n * @param asPath the as path of the prefetched page\n */\n async prefetch(\n url: string,\n asPath: string = url,\n options: PrefetchOptions = {}\n ): Promise {\n let parsed = parseRelativeUrl(url)\n\n let { pathname } = parsed\n\n if (process.env.__NEXT_I18N_SUPPORT) {\n if (options.locale === false) {\n pathname = normalizeLocalePath!(pathname, this.locales).pathname\n parsed.pathname = pathname\n url = formatWithValidation(parsed)\n\n let parsedAs = parseRelativeUrl(asPath)\n const localePathResult = normalizeLocalePath!(\n parsedAs.pathname,\n this.locales\n )\n parsedAs.pathname = localePathResult.pathname\n options.locale = localePathResult.detectedLocale || this.defaultLocale\n asPath = formatWithValidation(parsedAs)\n }\n }\n\n const pages = await this.pageLoader.getPageList()\n let resolvedAs = asPath\n\n if (process.env.__NEXT_HAS_REWRITES && asPath.startsWith('/')) {\n let rewrites: any\n ;({ __rewrites: rewrites } = await getClientBuildManifest())\n\n const rewritesResult = resolveRewrites(\n addBasePath(addLocale(asPath, this.locale)),\n pages,\n rewrites,\n parsed.query,\n (p: string) => resolveDynamicRoute(p, pages),\n this.locales\n )\n resolvedAs = delLocale(delBasePath(rewritesResult.asPath), this.locale)\n\n if (rewritesResult.matchedPage && rewritesResult.resolvedHref) {\n // if this directly matches a page we need to update the href to\n // allow the correct page chunk to be loaded\n pathname = rewritesResult.resolvedHref\n parsed.pathname = pathname\n url = formatWithValidation(parsed)\n }\n } else {\n parsed.pathname = resolveDynamicRoute(parsed.pathname, pages)\n\n if (parsed.pathname !== pathname) {\n pathname = parsed.pathname\n url = formatWithValidation(parsed)\n }\n }\n const route = removePathTrailingSlash(pathname)\n\n // Prefetch is not supported in development mode because it would trigger on-demand-entries\n if (process.env.NODE_ENV !== 'production') {\n return\n }\n\n await Promise.all([\n this.pageLoader._isSsg(route).then((isSsg: boolean) => {\n return isSsg\n ? this._getStaticData(\n this.pageLoader.getDataHref(\n url,\n resolvedAs,\n true,\n typeof options.locale !== 'undefined'\n ? options.locale\n : this.locale\n )\n )\n : false\n }),\n this.pageLoader[options.priority ? 'loadPage' : 'prefetch'](route),\n ])\n }\n\n async fetchComponent(route: string): Promise {\n let cancelled = false\n const cancel = (this.clc = () => {\n cancelled = true\n })\n\n const componentResult = await this.pageLoader.loadPage(route)\n\n if (cancelled) {\n const error: any = new Error(\n `Abort fetching component for route: \"${route}\"`\n )\n error.cancelled = true\n throw error\n }\n\n if (cancel === this.clc) {\n this.clc = null\n }\n\n return componentResult\n }\n\n _getData(fn: () => Promise): Promise {\n let cancelled = false\n const cancel = () => {\n cancelled = true\n }\n this.clc = cancel\n return fn().then((data) => {\n if (cancel === this.clc) {\n this.clc = null\n }\n\n if (cancelled) {\n const err: any = new Error('Loading initial props cancelled')\n err.cancelled = true\n throw err\n }\n\n return data\n })\n }\n\n _getStaticData(dataHref: string): Promise {\n const { href: cacheKey } = new URL(dataHref, window.location.href)\n if (\n process.env.NODE_ENV === 'production' &&\n !this.isPreview &&\n this.sdc[cacheKey]\n ) {\n return Promise.resolve(this.sdc[cacheKey])\n }\n return fetchNextData(dataHref, this.isSsr).then((data) => {\n this.sdc[cacheKey] = data\n return data\n })\n }\n\n _getServerData(dataHref: string): Promise {\n const { href: resourceKey } = new URL(dataHref, window.location.href)\n if (this.sdr[resourceKey]) {\n return this.sdr[resourceKey]\n }\n return (this.sdr[resourceKey] = fetchNextData(dataHref, this.isSsr)\n .then((data) => {\n delete this.sdr[resourceKey]\n return data\n })\n .catch((err) => {\n delete this.sdr[resourceKey]\n throw err\n }))\n }\n\n getInitialProps(\n Component: ComponentType,\n ctx: NextPageContext\n ): Promise {\n const { Component: App } = this.components['/_app']\n const AppTree = this._wrapApp(App as AppComponent)\n ctx.AppTree = AppTree\n return loadGetInitialProps>(App, {\n AppTree,\n Component,\n router: this,\n ctx,\n })\n }\n\n abortComponentLoad(as: string, routeProps: RouteProperties): void {\n if (this.clc) {\n Router.events.emit(\n 'routeChangeError',\n buildCancellationError(),\n as,\n routeProps\n )\n this.clc()\n this.clc = null\n }\n }\n\n notify(\n data: PrivateRouteInfo,\n resetScroll: { x: number; y: number } | null\n ): Promise {\n return this.sub(\n data,\n this.components['/_app'].Component as AppComponent,\n resetScroll\n )\n }\n}\n","import { IncomingMessage, ServerResponse } from 'http'\nimport { ParsedUrlQuery } from 'querystring'\nimport { ComponentType } from 'react'\nimport { UrlObject } from 'url'\nimport { formatUrl } from './router/utils/format-url'\nimport { NextRouter } from './router/router'\nimport { Env } from '@next/env'\nimport { BuildManifest } from '../server/get-page-files'\nimport { DomainLocales } from '../server/config'\nimport { PreviewData } from 'next/types'\n\n/**\n * Types used by both next and next-server\n */\n\nexport type NextComponentType<\n C extends BaseContext = NextPageContext,\n IP = {},\n P = {}\n> = ComponentType

& {\n /**\n * Used for initial page load data population. Data returned from `getInitialProps` is serialized when server rendered.\n * Make sure to return plain `Object` without using `Date`, `Map`, `Set`.\n * @param ctx Context of `page`\n */\n getInitialProps?(context: C): IP | Promise\n}\n\nexport type DocumentType = NextComponentType<\n DocumentContext,\n DocumentInitialProps,\n DocumentProps\n> & {\n renderDocument(\n Document: DocumentType,\n props: DocumentProps\n ): React.ReactElement\n}\n\nexport type AppType = NextComponentType<\n AppContextType,\n AppInitialProps,\n AppPropsType\n>\n\nexport type AppTreeType = ComponentType<\n AppInitialProps & { [name: string]: any }\n>\n\n/**\n * Web vitals provided to _app.reportWebVitals by Core Web Vitals plugin developed by Google Chrome team.\n * https://nextjs.org/blog/next-9-4#integrated-web-vitals-reporting\n */\nexport type NextWebVitalsMetric = {\n id: string\n label: string\n name: string\n startTime: number\n value: number\n}\n\nexport type Enhancer = (Component: C) => C\n\nexport type ComponentsEnhancer =\n | {\n enhanceApp?: Enhancer\n enhanceComponent?: Enhancer\n }\n | Enhancer\n\nexport type RenderPageResult = {\n html: string\n head?: Array\n}\n\nexport type RenderPage = (\n options?: ComponentsEnhancer\n) => RenderPageResult | Promise\n\nexport type BaseContext = {\n res?: ServerResponse\n [k: string]: any\n}\n\nexport type NEXT_DATA = {\n props: Record\n page: string\n query: ParsedUrlQuery\n buildId: string\n assetPrefix?: string\n runtimeConfig?: { [key: string]: any }\n nextExport?: boolean\n autoExport?: boolean\n isFallback?: boolean\n dynamicIds?: (string | number)[]\n err?: Error & { statusCode?: number }\n gsp?: boolean\n gssp?: boolean\n customServer?: boolean\n gip?: boolean\n appGip?: boolean\n locale?: string\n locales?: string[]\n defaultLocale?: string\n domainLocales?: DomainLocales\n scriptLoader?: any[]\n isPreview?: boolean\n}\n\n/**\n * `Next` context\n */\nexport interface NextPageContext {\n /**\n * Error object if encountered during rendering\n */\n err?: (Error & { statusCode?: number }) | null\n /**\n * `HTTP` request object.\n */\n req?: IncomingMessage\n /**\n * `HTTP` response object.\n */\n res?: ServerResponse\n /**\n * Path section of `URL`.\n */\n pathname: string\n /**\n * Query string section of `URL` parsed as an object.\n */\n query: ParsedUrlQuery\n /**\n * `String` of the actual path including query.\n */\n asPath?: string\n /**\n * The currently active locale\n */\n locale?: string\n /**\n * All configured locales\n */\n locales?: string[]\n /**\n * The configured default locale\n */\n defaultLocale?: string\n /**\n * `Component` the tree of the App to use if needing to render separately\n */\n AppTree: AppTreeType\n}\n\nexport type AppContextType = {\n Component: NextComponentType\n AppTree: AppTreeType\n ctx: NextPageContext\n router: R\n}\n\nexport type AppInitialProps = {\n pageProps: any\n}\n\nexport type AppPropsType<\n R extends NextRouter = NextRouter,\n P = {}\n> = AppInitialProps & {\n Component: NextComponentType\n router: R\n __N_SSG?: boolean\n __N_SSP?: boolean\n}\n\nexport type DocumentContext = NextPageContext & {\n renderPage: RenderPage\n}\n\nexport type DocumentInitialProps = RenderPageResult & {\n styles?: React.ReactElement[] | React.ReactFragment\n}\n\nexport type DocumentProps = DocumentInitialProps & {\n __NEXT_DATA__: NEXT_DATA\n dangerousAsPath: string\n docComponentsRendered: {\n Html?: boolean\n Main?: boolean\n Head?: boolean\n NextScript?: boolean\n }\n buildManifest: BuildManifest\n ampPath: string\n inAmpMode: boolean\n hybridAmp: boolean\n isDevelopment: boolean\n dynamicImports: string[]\n assetPrefix?: string\n canonicalBase: string\n headTags: any[]\n unstable_runtimeJS?: false\n unstable_JsPreload?: false\n devOnlyCacheBusterQueryString: string\n scriptLoader: { afterInteractive?: string[]; beforeInteractive?: any[] }\n locale?: string\n disableOptimizedLoading?: boolean\n}\n\n/**\n * Next `API` route request\n */\nexport interface NextApiRequest extends IncomingMessage {\n /**\n * Object of `query` values from url\n */\n query: {\n [key: string]: string | string[]\n }\n /**\n * Object of `cookies` from header\n */\n cookies: {\n [key: string]: string\n }\n\n body: any\n\n env: Env\n\n preview?: boolean\n /**\n * Preview data set on the request, if any\n * */\n previewData?: PreviewData\n}\n\n/**\n * Send body of response\n */\ntype Send = (body: T) => void\n\n/**\n * Next `API` route response\n */\nexport type NextApiResponse = ServerResponse & {\n /**\n * Send data `any` data in response\n */\n send: Send\n /**\n * Send data `json` data in response\n */\n json: Send\n status: (statusCode: number) => NextApiResponse\n redirect(url: string): NextApiResponse\n redirect(status: number, url: string): NextApiResponse\n\n /**\n * Set preview data for Next.js' prerender mode\n */\n setPreviewData: (\n data: object | string,\n options?: {\n /**\n * Specifies the number (in seconds) for the preview session to last for.\n * The given number will be converted to an integer by rounding down.\n * By default, no maximum age is set and the preview session finishes\n * when the client shuts down (browser is closed).\n */\n maxAge?: number\n }\n ) => NextApiResponse\n clearPreviewData: () => NextApiResponse\n}\n\n/**\n * Next `API` route handler\n */\nexport type NextApiHandler = (\n req: NextApiRequest,\n res: NextApiResponse\n) => void | Promise\n\n/**\n * Utils\n */\nexport function execOnce ReturnType>(\n fn: T\n): T {\n let used = false\n let result: ReturnType\n\n return ((...args: any[]) => {\n if (!used) {\n used = true\n result = fn(...args)\n }\n return result\n }) as T\n}\n\nexport function getLocationOrigin() {\n const { protocol, hostname, port } = window.location\n return `${protocol}//${hostname}${port ? ':' + port : ''}`\n}\n\nexport function getURL() {\n const { href } = window.location\n const origin = getLocationOrigin()\n return href.substring(origin.length)\n}\n\nexport function getDisplayName

(Component: ComponentType

) {\n return typeof Component === 'string'\n ? Component\n : Component.displayName || Component.name || 'Unknown'\n}\n\nexport function isResSent(res: ServerResponse) {\n return res.finished || res.headersSent\n}\n\nexport async function loadGetInitialProps<\n C extends BaseContext,\n IP = {},\n P = {}\n>(App: NextComponentType, ctx: C): Promise {\n if (process.env.NODE_ENV !== 'production') {\n if (App.prototype?.getInitialProps) {\n const message = `\"${getDisplayName(\n App\n )}.getInitialProps()\" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.`\n throw new Error(message)\n }\n }\n // when called from _app `ctx` is nested in `ctx`\n const res = ctx.res || (ctx.ctx && ctx.ctx.res)\n\n if (!App.getInitialProps) {\n if (ctx.ctx && ctx.Component) {\n // @ts-ignore pageProps default\n return {\n pageProps: await loadGetInitialProps(ctx.Component, ctx.ctx),\n }\n }\n return {} as IP\n }\n\n const props = await App.getInitialProps(ctx)\n\n if (res && isResSent(res)) {\n return props\n }\n\n if (!props) {\n const message = `\"${getDisplayName(\n App\n )}.getInitialProps()\" should resolve to an object. But found \"${props}\" instead.`\n throw new Error(message)\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (Object.keys(props).length === 0 && !ctx.ctx) {\n console.warn(\n `${getDisplayName(\n App\n )} returned an empty object from \\`getInitialProps\\`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps`\n )\n }\n }\n\n return props\n}\n\nexport const urlObjectKeys = [\n 'auth',\n 'hash',\n 'host',\n 'hostname',\n 'href',\n 'path',\n 'pathname',\n 'port',\n 'protocol',\n 'query',\n 'search',\n 'slashes',\n]\n\nexport function formatWithValidation(url: UrlObject): string {\n if (process.env.NODE_ENV === 'development') {\n if (url !== null && typeof url === 'object') {\n Object.keys(url).forEach((key) => {\n if (urlObjectKeys.indexOf(key) === -1) {\n console.warn(\n `Unknown key passed via urlObject into url.format: ${key}`\n )\n }\n })\n }\n }\n\n return formatUrl(url)\n}\n\nexport const SP = typeof performance !== 'undefined'\nexport const ST =\n SP &&\n typeof performance.mark === 'function' &&\n typeof performance.measure === 'function'\n","import { getRouteRegex } from './route-regex'\n\nexport function getRouteMatcher(routeRegex: ReturnType) {\n const { re, groups } = routeRegex\n return (pathname: string | null | undefined) => {\n const routeMatch = re.exec(pathname!)\n if (!routeMatch) {\n return false\n }\n\n const decode = (param: string) => {\n try {\n return decodeURIComponent(param)\n } catch (_) {\n const err: Error & { code?: string } = new Error(\n 'failed to decode param'\n )\n err.code = 'DECODE_FAILED'\n throw err\n }\n }\n const params: { [paramName: string]: string | string[] } = {}\n\n Object.keys(groups).forEach((slugName: string) => {\n const g = groups[slugName]\n const m = routeMatch[g.pos]\n if (m !== undefined) {\n params[slugName] = ~m.indexOf('/')\n ? m.split('/').map((entry) => decode(entry))\n : g.repeat\n ? [decode(m)]\n : decode(m)\n }\n })\n return params\n }\n}\n","import { getLocationOrigin } from '../../utils'\nimport { searchParamsToUrlQuery } from './querystring'\n\n/**\n * Parses path-relative urls (e.g. `/hello/world?foo=bar`). If url isn't path-relative\n * (e.g. `./hello`) then at least base must be.\n * Absolute urls are rejected with one exception, in the browser, absolute urls that are on\n * the current origin will be parsed as relative\n */\nexport function parseRelativeUrl(url: string, base?: string) {\n const globalBase = new URL(\n typeof window === 'undefined' ? 'http://n' : getLocationOrigin()\n )\n const resolvedBase = base ? new URL(base, globalBase) : globalBase\n const { pathname, searchParams, search, hash, href, origin } = new URL(\n url,\n resolvedBase\n )\n if (origin !== globalBase.origin) {\n throw new Error(`invariant: invalid relative URL, router received ${url}`)\n }\n return {\n pathname,\n query: searchParamsToUrlQuery(searchParams),\n search,\n hash,\n href: href.slice(globalBase.origin.length),\n }\n}\n","function _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nmodule.exports = _iterableToArrayLimit;","/* global window */\nimport React from 'react'\nimport Router, { NextRouter } from '../next-server/lib/router/router'\nimport { RouterContext } from '../next-server/lib/router-context'\n\ntype ClassArguments = T extends new (...args: infer U) => any ? U : any\n\ntype RouterArgs = ClassArguments\n\ntype SingletonRouterBase = {\n router: Router | null\n readyCallbacks: Array<() => any>\n ready(cb: () => any): void\n}\n\nexport { Router, NextRouter }\n\nexport type SingletonRouter = SingletonRouterBase & NextRouter\n\nconst singletonRouter: SingletonRouterBase = {\n router: null, // holds the actual router instance\n readyCallbacks: [],\n ready(cb: () => void) {\n if (this.router) return cb()\n if (typeof window !== 'undefined') {\n this.readyCallbacks.push(cb)\n }\n },\n}\n\n// Create public properties and methods of the router in the singletonRouter\nconst urlPropertyFields = [\n 'pathname',\n 'route',\n 'query',\n 'asPath',\n 'components',\n 'isFallback',\n 'basePath',\n 'locale',\n 'locales',\n 'defaultLocale',\n 'isReady',\n 'isPreview',\n 'isLocaleDomain',\n]\nconst routerEvents = [\n 'routeChangeStart',\n 'beforeHistoryChange',\n 'routeChangeComplete',\n 'routeChangeError',\n 'hashChangeStart',\n 'hashChangeComplete',\n]\nconst coreMethodFields = [\n 'push',\n 'replace',\n 'reload',\n 'back',\n 'prefetch',\n 'beforePopState',\n]\n\n// Events is a static property on the router, the router doesn't have to be initialized to use it\nObject.defineProperty(singletonRouter, 'events', {\n get() {\n return Router.events\n },\n})\n\nurlPropertyFields.forEach((field: string) => {\n // Here we need to use Object.defineProperty because, we need to return\n // the property assigned to the actual router\n // The value might get changed as we change routes and this is the\n // proper way to access it\n Object.defineProperty(singletonRouter, field, {\n get() {\n const router = getRouter() as any\n return router[field] as string\n },\n })\n})\n\ncoreMethodFields.forEach((field: string) => {\n // We don't really know the types here, so we add them later instead\n ;(singletonRouter as any)[field] = (...args: any[]) => {\n const router = getRouter() as any\n return router[field](...args)\n }\n})\n\nrouterEvents.forEach((event: string) => {\n singletonRouter.ready(() => {\n Router.events.on(event, (...args) => {\n const eventField = `on${event.charAt(0).toUpperCase()}${event.substring(\n 1\n )}`\n const _singletonRouter = singletonRouter as any\n if (_singletonRouter[eventField]) {\n try {\n _singletonRouter[eventField](...args)\n } catch (err) {\n console.error(`Error when running the Router event: ${eventField}`)\n console.error(`${err.message}\\n${err.stack}`)\n }\n }\n })\n })\n})\n\nfunction getRouter(): Router {\n if (!singletonRouter.router) {\n const message =\n 'No router instance found.\\n' +\n 'You should only use \"next/router\" inside the client side of your app.\\n'\n throw new Error(message)\n }\n return singletonRouter.router\n}\n\n// Export the singletonRouter and this is the public API.\nexport default singletonRouter as SingletonRouter\n\n// Reexport the withRoute HOC\nexport { default as withRouter } from './with-router'\n\nexport function useRouter(): NextRouter {\n return React.useContext(RouterContext)\n}\n\n// INTERNAL APIS\n// -------------\n// (do not use following exports inside the app)\n\n// Create a router and assign it as the singleton instance.\n// This is used in client side when we are initilizing the app.\n// This should **not** use inside the server.\nexport const createRouter = (...args: RouterArgs): Router => {\n singletonRouter.router = new Router(...args)\n singletonRouter.readyCallbacks.forEach((cb) => cb())\n singletonRouter.readyCallbacks = []\n\n return singletonRouter.router\n}\n\n// This function is used to create the `withRouter` router instance\nexport function makePublicRouterInstance(router: Router): NextRouter {\n const _router = router as any\n const instance = {} as any\n\n for (const property of urlPropertyFields) {\n if (typeof _router[property] === 'object') {\n instance[property] = Object.assign(\n Array.isArray(_router[property]) ? [] : {},\n _router[property]\n ) // makes sure query is not stateful\n continue\n }\n\n instance[property] = _router[property]\n }\n\n // Events is a static property on the router, the router doesn't have to be initialized to use it\n instance.events = Router.events\n\n coreMethodFields.forEach((field) => {\n instance[field] = (...args: any[]) => {\n return _router[field](...args)\n }\n })\n\n return instance\n}\n","import React from 'react'\nimport { NextRouter } from './router/router'\n\nexport const RouterContext = React.createContext(null as any)\n\nif (process.env.NODE_ENV !== 'production') {\n RouterContext.displayName = 'RouterContext'\n}\n","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nvar isNativeReflectConstruct = require(\"./isNativeReflectConstruct\");\n\nfunction _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n module.exports = _construct = Reflect.construct;\n } else {\n module.exports = _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}\n\nmodule.exports = _construct;","function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nmodule.exports = _arrayWithHoles;","\"use strict\";exports.__esModule=true;exports.normalizePathSep=normalizePathSep;exports.denormalizePagePath=denormalizePagePath;function normalizePathSep(path){return path.replace(/\\\\/g,'/');}function denormalizePagePath(page){page=normalizePathSep(page);if(page.startsWith('/index/')){page=page.slice(6);}else if(page==='/index'){page='/';}return page;}\n//# sourceMappingURL=denormalize-page-path.js.map","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableRest;","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n\nmodule.exports = _asyncToGenerator;"],"sourceRoot":""}