{"ast":null,"code":"\"use strict\";\n\nvar _regeneratorRuntime = require(\"/Users/dhrumil1/Documents/Tethy/online-verification/node_modules/@babel/runtime/regenerator\");\n\nvar _asyncToGenerator = require(\"/Users/dhrumil1/Documents/Tethy/online-verification/node_modules/@babel/runtime/helpers/asyncToGenerator\");\n\nvar _classCallCheck = require(\"/Users/dhrumil1/Documents/Tethy/online-verification/node_modules/@babel/runtime/helpers/classCallCheck\");\n\nvar _createClass = require(\"/Users/dhrumil1/Documents/Tethy/online-verification/node_modules/@babel/runtime/helpers/createClass\");\n\nvar _inherits = require(\"/Users/dhrumil1/Documents/Tethy/online-verification/node_modules/@babel/runtime/helpers/inherits\");\n\nvar _possibleConstructorReturn = require(\"/Users/dhrumil1/Documents/Tethy/online-verification/node_modules/@babel/runtime/helpers/possibleConstructorReturn\");\n\nvar _getPrototypeOf = require(\"/Users/dhrumil1/Documents/Tethy/online-verification/node_modules/@babel/runtime/helpers/getPrototypeOf\");\n\nvar _slicedToArray = require(\"/Users/dhrumil1/Documents/Tethy/online-verification/node_modules/@babel/runtime/helpers/slicedToArray\");\n\nvar _s = $RefreshSig$(),\n    _s2 = $RefreshSig$();\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nvar _interopRequireWildcard3 = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.render = render;\nexports.renderError = renderError;\nexports[\"default\"] = exports.emitter = exports.router = exports.version = void 0;\n\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\n\nvar _interopRequireWildcard2 = _interopRequireDefault(require(\"@babel/runtime/helpers/interopRequireWildcard\"));\n\nrequire(\"@next/polyfill-module\");\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactDom = _interopRequireDefault(require(\"react-dom\"));\n\nvar _headManagerContext = require(\"../next-server/lib/head-manager-context\");\n\nvar _mitt = _interopRequireDefault(require(\"../next-server/lib/mitt\"));\n\nvar _routerContext = require(\"../next-server/lib/router-context\");\n\nvar _router = require(\"../next-server/lib/router/router\");\n\nvar _isDynamic = require(\"../next-server/lib/router/utils/is-dynamic\");\n\nvar querystring = _interopRequireWildcard3(require(\"../next-server/lib/router/utils/querystring\"));\n\nvar envConfig = _interopRequireWildcard3(require(\"../next-server/lib/runtime-config\"));\n\nvar _utils = require(\"../next-server/lib/utils\");\n\nvar _headManager = _interopRequireDefault(require(\"./head-manager\"));\n\nvar _pageLoader = _interopRequireDefault(require(\"./page-loader\"));\n\nvar _performanceRelayer = _interopRequireDefault(require(\"./performance-relayer\"));\n\nvar _router2 = require(\"./router\");\n/* global location */\n\n\nvar data = JSON.parse(document.getElementById('__NEXT_DATA__').textContent);\nwindow.__NEXT_DATA__ = data;\nvar version = \"10.0.3\";\nexports.version = version;\n\nvar looseToArray = function looseToArray(input) {\n  return [].slice.call(input);\n};\n\nvar hydrateProps = data.props,\n    hydrateErr = data.err,\n    page = data.page,\n    query = data.query,\n    buildId = data.buildId,\n    assetPrefix = data.assetPrefix,\n    runtimeConfig = data.runtimeConfig,\n    dynamicIds = data.dynamicIds,\n    isFallback = data.isFallback,\n    locales = data.locales;\nvar locale = data.locale,\n    defaultLocale = data.defaultLocale;\nvar prefix = assetPrefix || ''; // With dynamic assetPrefix it's no longer possible to set assetPrefix at the build time\n// So, this is how we do it in the client side at runtime\n\n__webpack_public_path__ = \"\".concat(prefix, \"/_next/\"); //eslint-disable-line\n// Initialize next/config with the environment configuration\n\nenvConfig.setConfig({\n  serverRuntimeConfig: {},\n  publicRuntimeConfig: runtimeConfig || {}\n});\nvar asPath = (0, _utils.getURL)(); // make sure not to attempt stripping basePath for 404s\n\nif ((0, _router.hasBasePath)(asPath)) {\n  asPath = (0, _router.delBasePath)(asPath);\n}\n\nif (process.env.__NEXT_I18N_SUPPORT) {\n  var _require = require('../next-server/lib/i18n/normalize-locale-path'),\n      normalizeLocalePath = _require.normalizeLocalePath;\n\n  var _require2 = require('../next-server/lib/i18n/detect-domain-locale'),\n      detectDomainLocale = _require2.detectDomainLocale;\n\n  var _require3 = require('../next-server/lib/router/utils/parse-relative-url'),\n      parseRelativeUrl = _require3.parseRelativeUrl;\n\n  var _require4 = require('../next-server/lib/router/utils/format-url'),\n      formatUrl = _require4.formatUrl;\n\n  if (locales) {\n    var parsedAs = parseRelativeUrl(asPath);\n    var localePathResult = normalizeLocalePath(parsedAs.pathname, locales);\n\n    if (localePathResult.detectedLocale) {\n      parsedAs.pathname = localePathResult.pathname;\n      asPath = formatUrl(parsedAs);\n    } else {\n      // derive the default locale if it wasn't detected in the asPath\n      // since we don't prerender static pages with all possible default\n      // locales\n      defaultLocale = locale;\n    } // attempt detecting default locale based on hostname\n\n\n    var detectedDomain = detectDomainLocale(process.env.__NEXT_I18N_DOMAINS, window.location.hostname); // TODO: investigate if defaultLocale needs to be populated after\n    // hydration to prevent mismatched renders\n\n    if (detectedDomain) {\n      defaultLocale = detectedDomain.defaultLocale;\n    }\n  }\n}\n\nvar pageLoader = new _pageLoader[\"default\"](buildId, prefix);\n\nvar register = function register(_ref) {\n  var _ref2 = _slicedToArray(_ref, 2),\n      r = _ref2[0],\n      f = _ref2[1];\n\n  return pageLoader.routeLoader.onEntrypoint(r, f);\n};\n\nif (window.__NEXT_P) {\n  // Defer page registration for another tick. This will increase the overall\n  // latency in hydrating the page, but reduce the total blocking time.\n  window.__NEXT_P.map(function (p) {\n    return setTimeout(function () {\n      return register(p);\n    }, 0);\n  });\n}\n\nwindow.__NEXT_P = [];\nwindow.__NEXT_P.push = register;\nvar headManager = (0, _headManager[\"default\"])();\nvar appElement = document.getElementById('__next');\nvar lastAppProps;\n\nvar _lastRenderReject;\n\nvar webpackHMR;\nvar router;\nexports.router = router;\nvar CachedComponent;\nvar CachedApp, onPerfEntry;\n\nvar Container = /*#__PURE__*/function (_react$default$Compon) {\n  _inherits(Container, _react$default$Compon);\n\n  var _super = _createSuper(Container);\n\n  function Container() {\n    _classCallCheck(this, Container);\n\n    return _super.apply(this, arguments);\n  }\n\n  _createClass(Container, [{\n    key: \"componentDidCatch\",\n    value: function componentDidCatch(componentErr, info) {\n      this.props.fn(componentErr, info);\n    }\n  }, {\n    key: \"componentDidMount\",\n    value: function componentDidMount() {\n      this.scrollToHash(); // We need to replace the router state if:\n      // - the page was (auto) exported and has a query string or search (hash)\n      // - it was auto exported and is a dynamic route (to provide params)\n      // - if it is a client-side skeleton (fallback render)\n\n      if (router.isSsr && (isFallback || data.nextExport && ((0, _isDynamic.isDynamicRoute)(router.pathname) || location.search) || hydrateProps && hydrateProps.__N_SSG && location.search)) {\n        // update query on mount for exported pages\n        router.replace(router.pathname + '?' + String(querystring.assign(querystring.urlQueryToSearchParams(router.query), new URLSearchParams(location.search))), asPath, {\n          // @ts-ignore\n          // WARNING: `_h` is an internal option for handing Next.js\n          // client-side hydration. Your app should _never_ use this property.\n          // It may change at any time without notice.\n          _h: 1,\n          // Fallback pages must trigger the data fetch, so the transition is\n          // not shallow.\n          // Other pages (strictly updating query) happens shallowly, as data\n          // requirements would already be present.\n          shallow: !isFallback\n        });\n      }\n    }\n  }, {\n    key: \"componentDidUpdate\",\n    value: function componentDidUpdate() {\n      this.scrollToHash();\n    }\n  }, {\n    key: \"scrollToHash\",\n    value: function scrollToHash() {\n      var _location = location,\n          hash = _location.hash;\n      hash = hash && hash.substring(1);\n      if (!hash) return;\n      var el = document.getElementById(hash);\n      if (!el) return; // If we call scrollIntoView() in here without a setTimeout\n      // it won't scroll properly.\n\n      setTimeout(function () {\n        return el.scrollIntoView();\n      }, 0);\n    }\n  }, {\n    key: \"render\",\n    value: function render() {\n      if (false) {\n        return this.props.children;\n      } else {\n        var _require5 = require('@next/react-dev-overlay/lib/client'),\n            ReactDevOverlay = _require5.ReactDevOverlay;\n\n        return /*#__PURE__*/_react[\"default\"].createElement(ReactDevOverlay, null, this.props.children);\n      }\n    }\n  }]);\n\n  return Container;\n}(_react[\"default\"].Component);\n\nvar emitter = (0, _mitt[\"default\"])();\nexports.emitter = emitter;\n\nvar _default = /*#__PURE__*/function () {\n  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {\n    var opts,\n        appEntrypoint,\n        app,\n        mod,\n        initialErr,\n        pageEntrypoint,\n        _require6,\n        isValidElementType,\n        _require7,\n        getNodeError,\n        renderCtx,\n        _args = arguments;\n\n    return _regeneratorRuntime.wrap(function _callee$(_context) {\n      while (1) {\n        switch (_context.prev = _context.next) {\n          case 0:\n            opts = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};\n\n            // This makes sure this specific lines are removed in production\n            if (true) {\n              webpackHMR = opts.webpackHMR;\n            }\n\n            _context.next = 4;\n            return pageLoader.routeLoader.whenEntrypoint('/_app');\n\n          case 4:\n            appEntrypoint = _context.sent;\n\n            if (!('error' in appEntrypoint)) {\n              _context.next = 7;\n              break;\n            }\n\n            throw appEntrypoint.error;\n\n          case 7:\n            app = appEntrypoint.component, mod = appEntrypoint.exports;\n            CachedApp = app;\n\n            if (mod && mod.reportWebVitals) {\n              onPerfEntry = function onPerfEntry(_ref4) {\n                var id = _ref4.id,\n                    name = _ref4.name,\n                    startTime = _ref4.startTime,\n                    value = _ref4.value,\n                    duration = _ref4.duration,\n                    entryType = _ref4.entryType,\n                    entries = _ref4.entries;\n                // Combines timestamp with random number for unique ID\n                var uniqueID = \"\".concat(Date.now(), \"-\").concat(Math.floor(Math.random() * (9e12 - 1)) + 1e12);\n                var perfStartEntry;\n\n                if (entries && entries.length) {\n                  perfStartEntry = entries[0].startTime;\n                }\n\n                mod.reportWebVitals({\n                  id: id || uniqueID,\n                  name: name,\n                  startTime: startTime || perfStartEntry,\n                  value: value == null ? duration : value,\n                  label: entryType === 'mark' || entryType === 'measure' ? 'custom' : 'web-vital'\n                });\n              };\n            }\n\n            initialErr = hydrateErr;\n            _context.prev = 11;\n\n            if (!(true && hydrateErr)) {\n              _context.next = 16;\n              break;\n            }\n\n            _context.t0 = {\n              error: hydrateErr\n            };\n            _context.next = 19;\n            break;\n\n          case 16:\n            _context.next = 18;\n            return pageLoader.routeLoader.whenEntrypoint(page);\n\n          case 18:\n            _context.t0 = _context.sent;\n\n          case 19:\n            pageEntrypoint = _context.t0;\n\n            if (!('error' in pageEntrypoint)) {\n              _context.next = 22;\n              break;\n            }\n\n            throw pageEntrypoint.error;\n\n          case 22:\n            CachedComponent = pageEntrypoint.component;\n\n            if (!true) {\n              _context.next = 27;\n              break;\n            }\n\n            _require6 = require('react-is'), isValidElementType = _require6.isValidElementType;\n\n            if (isValidElementType(CachedComponent)) {\n              _context.next = 27;\n              break;\n            }\n\n            throw new Error(\"The default export is not a React Component in page: \\\"\".concat(page, \"\\\"\"));\n\n          case 27:\n            _context.next = 32;\n            break;\n\n          case 29:\n            _context.prev = 29;\n            _context.t1 = _context[\"catch\"](11);\n            // This catches errors like throwing in the top level of a module\n            initialErr = _context.t1;\n\n          case 32:\n            if (true) {\n              _require7 = require('@next/react-dev-overlay/lib/client'), getNodeError = _require7.getNodeError; // Server-side runtime errors need to be re-thrown on the client-side so\n              // that the overlay is rendered.\n\n              if (initialErr) {\n                if (initialErr === hydrateErr) {\n                  setTimeout(function () {\n                    var error;\n\n                    try {\n                      // Generate a new error object. We `throw` it because some browsers\n                      // will set the `stack` when thrown, and we want to ensure ours is\n                      // not overridden when we re-throw it below.\n                      throw new Error(initialErr.message);\n                    } catch (e) {\n                      error = e;\n                    }\n\n                    error.name = initialErr.name;\n                    error.stack = initialErr.stack;\n                    var node = getNodeError(error);\n                    throw node;\n                  });\n                } // We replaced the server-side error with a client-side error, and should\n                // no longer rewrite the stack trace to a Node error.\n                else {\n                    setTimeout(function () {\n                      throw initialErr;\n                    });\n                  }\n              }\n            }\n\n            if (!window.__NEXT_PRELOADREADY) {\n              _context.next = 36;\n              break;\n            }\n\n            _context.next = 36;\n            return window.__NEXT_PRELOADREADY(dynamicIds);\n\n          case 36:\n            exports.router = router = (0, _router2.createRouter)(page, query, asPath, {\n              initialProps: hydrateProps,\n              pageLoader: pageLoader,\n              App: CachedApp,\n              Component: CachedComponent,\n              wrapApp: wrapApp,\n              err: initialErr,\n              isFallback: Boolean(isFallback),\n              subscription: function subscription(info, App) {\n                return render(Object.assign({}, info, {\n                  App: App\n                }));\n              },\n              locale: locale,\n              locales: locales,\n              defaultLocale: defaultLocale\n            }); // call init-client middleware\n\n            if (process.env.__NEXT_PLUGINS) {\n              // @ts-ignore\n              // eslint-disable-next-line\n              Promise.resolve().then(function () {\n                return (0, _interopRequireWildcard2[\"default\"])(require('next-plugin-loader?middleware=on-init-client!'));\n              }).then(function (initClientModule) {\n                return initClientModule[\"default\"]({\n                  router: router\n                });\n              })[\"catch\"](function (initClientErr) {\n                console.error('Error calling client-init for plugins', initClientErr);\n              });\n            }\n\n            renderCtx = {\n              App: CachedApp,\n              initial: true,\n              Component: CachedComponent,\n              props: hydrateProps,\n              err: initialErr\n            };\n\n            if (!false) {\n              _context.next = 44;\n              break;\n            }\n\n            render(renderCtx);\n            return _context.abrupt(\"return\", emitter);\n\n          case 44:\n            return _context.abrupt(\"return\", {\n              emitter: emitter,\n              render: render,\n              renderCtx: renderCtx\n            });\n\n          case 45:\n          case \"end\":\n            return _context.stop();\n        }\n      }\n    }, _callee, null, [[11, 29]]);\n  }));\n\n  return function _default() {\n    return _ref3.apply(this, arguments);\n  };\n}();\n\nexports[\"default\"] = _default;\n\nfunction render(_x) {\n  return _render.apply(this, arguments);\n} // This method handles all runtime and debug errors.\n// 404 and 500 errors are special kind of errors\n// and they are still handle via the main render method.\n\n\nfunction _render() {\n  _render = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(renderingProps) {\n    return _regeneratorRuntime.wrap(function _callee2$(_context2) {\n      while (1) {\n        switch (_context2.prev = _context2.next) {\n          case 0:\n            if (!renderingProps.err) {\n              _context2.next = 4;\n              break;\n            }\n\n            _context2.next = 3;\n            return renderError(renderingProps);\n\n          case 3:\n            return _context2.abrupt(\"return\");\n\n          case 4:\n            _context2.prev = 4;\n            _context2.next = 7;\n            return doRender(renderingProps);\n\n          case 7:\n            _context2.next = 16;\n            break;\n\n          case 9:\n            _context2.prev = 9;\n            _context2.t0 = _context2[\"catch\"](4);\n\n            if (!_context2.t0.cancelled) {\n              _context2.next = 13;\n              break;\n            }\n\n            throw _context2.t0;\n\n          case 13:\n            if (true) {\n              // Ensure this error is displayed in the overlay in development\n              setTimeout(function () {\n                throw _context2.t0;\n              });\n            }\n\n            _context2.next = 16;\n            return renderError((0, _extends2[\"default\"])({}, renderingProps, {\n              err: _context2.t0\n            }));\n\n          case 16:\n          case \"end\":\n            return _context2.stop();\n        }\n      }\n    }, _callee2, null, [[4, 9]]);\n  }));\n  return _render.apply(this, arguments);\n}\n\nfunction renderError(renderErrorProps) {\n  var App = renderErrorProps.App,\n      err = renderErrorProps.err; // In development runtime errors are caught by our overlay\n  // In production we catch runtime errors using componentDidCatch which will trigger renderError\n\n  if (true) {\n    // A Next.js rendering runtime error is always unrecoverable\n    // FIXME: let's make this recoverable (error in GIP client-transition)\n    webpackHMR.onUnrecoverableError(); // We need to render an empty <App> so that the `<ReactDevOverlay>` can\n    // render itself.\n\n    return doRender({\n      App: function App() {\n        return null;\n      },\n      props: {},\n      Component: function Component() {\n        return null;\n      },\n      styleSheets: []\n    });\n  }\n\n  if (process.env.__NEXT_PLUGINS) {\n    // @ts-ignore\n    // eslint-disable-next-line\n    Promise.resolve().then(function () {\n      return (0, _interopRequireWildcard2[\"default\"])(require('next-plugin-loader?middleware=on-error-client!'));\n    }).then(function (onClientErrorModule) {\n      return onClientErrorModule[\"default\"]({\n        err: err\n      });\n    })[\"catch\"](function (onClientErrorErr) {\n      console.error('error calling on-error-client for plugins', onClientErrorErr);\n    });\n  } // Make sure we log the error to the console, otherwise users can't track down issues.\n\n\n  console.error(err);\n  return pageLoader.loadPage('/_error').then(function (_ref5) {\n    var ErrorComponent = _ref5.page,\n        styleSheets = _ref5.styleSheets;\n    // In production we do a normal render with the `ErrorComponent` as component.\n    // If we've gotten here upon initial render, we can use the props from the server.\n    // Otherwise, we need to call `getInitialProps` on `App` before mounting.\n    var AppTree = wrapApp(App);\n    var appCtx = {\n      Component: ErrorComponent,\n      AppTree: AppTree,\n      router: router,\n      ctx: {\n        err: err,\n        pathname: page,\n        query: query,\n        asPath: asPath,\n        AppTree: AppTree\n      }\n    };\n    return Promise.resolve(renderErrorProps.props ? renderErrorProps.props : (0, _utils.loadGetInitialProps)(App, appCtx)).then(function (initProps) {\n      return doRender((0, _extends2[\"default\"])({}, renderErrorProps, {\n        err: err,\n        Component: ErrorComponent,\n        styleSheets: styleSheets,\n        props: initProps\n      }));\n    });\n  });\n}\n\nvar reactRoot = null;\nvar shouldUseHydrate = typeof _reactDom[\"default\"].hydrate === 'function';\n\nfunction renderReactElement(reactEl, domEl) {\n  if (process.env.__NEXT_REACT_MODE !== 'legacy') {\n    if (!reactRoot) {\n      var opts = {\n        hydrate: true\n      };\n      reactRoot = process.env.__NEXT_REACT_MODE === 'concurrent' ? _reactDom[\"default\"].unstable_createRoot(domEl, opts) : _reactDom[\"default\"].unstable_createBlockingRoot(domEl, opts);\n    }\n\n    reactRoot.render(reactEl);\n  } else {\n    // mark start of hydrate/render\n    if (_utils.ST) {\n      performance.mark('beforeRender');\n    } // The check for `.hydrate` is there to support React alternatives like preact\n\n\n    if (shouldUseHydrate) {\n      _reactDom[\"default\"].hydrate(reactEl, domEl, markHydrateComplete);\n\n      shouldUseHydrate = false;\n    } else {\n      _reactDom[\"default\"].render(reactEl, domEl, markRenderComplete);\n    }\n  }\n}\n\nfunction markHydrateComplete() {\n  if (!_utils.ST) return;\n  performance.mark('afterHydrate'); // mark end of hydration\n\n  performance.measure('Next.js-before-hydration', 'navigationStart', 'beforeRender');\n  performance.measure('Next.js-hydration', 'beforeRender', 'afterHydrate');\n\n  if (onPerfEntry) {\n    performance.getEntriesByName('Next.js-hydration').forEach(onPerfEntry);\n  }\n\n  clearMarks();\n}\n\nfunction markRenderComplete() {\n  if (!_utils.ST) return;\n  performance.mark('afterRender'); // mark end of render\n\n  var navStartEntries = performance.getEntriesByName('routeChange', 'mark');\n\n  if (!navStartEntries.length) {\n    return;\n  }\n\n  performance.measure('Next.js-route-change-to-render', navStartEntries[0].name, 'beforeRender');\n  performance.measure('Next.js-render', 'beforeRender', 'afterRender');\n\n  if (onPerfEntry) {\n    performance.getEntriesByName('Next.js-render').forEach(onPerfEntry);\n    performance.getEntriesByName('Next.js-route-change-to-render').forEach(onPerfEntry);\n  }\n\n  clearMarks();\n  ['Next.js-route-change-to-render', 'Next.js-render'].forEach(function (measure) {\n    return performance.clearMeasures(measure);\n  });\n}\n\nfunction clearMarks() {\n  ;\n  ['beforeRender', 'afterHydrate', 'afterRender', 'routeChange'].forEach(function (mark) {\n    return performance.clearMarks(mark);\n  });\n}\n\nfunction AppContainer(_ref6) {\n  var children = _ref6.children;\n  return /*#__PURE__*/_react[\"default\"].createElement(Container, {\n    fn: function fn(error) {\n      return renderError({\n        App: CachedApp,\n        err: error\n      })[\"catch\"](function (err) {\n        return console.error('Error rendering page: ', err);\n      });\n    }\n  }, /*#__PURE__*/_react[\"default\"].createElement(_routerContext.RouterContext.Provider, {\n    value: (0, _router2.makePublicRouterInstance)(router)\n  }, /*#__PURE__*/_react[\"default\"].createElement(_headManagerContext.HeadManagerContext.Provider, {\n    value: headManager\n  }, children)));\n}\n\n_c = AppContainer;\n\nvar wrapApp = function wrapApp(App) {\n  return function (wrappedAppProps) {\n    var appProps = (0, _extends2[\"default\"])({}, wrappedAppProps, {\n      Component: CachedComponent,\n      err: hydrateErr,\n      router: router\n    });\n    return /*#__PURE__*/_react[\"default\"].createElement(AppContainer, null, /*#__PURE__*/_react[\"default\"].createElement(App, appProps));\n  };\n};\n\nfunction doRender(input) {\n  var App = input.App,\n      Component = input.Component,\n      props = input.props,\n      err = input.err;\n  var styleSheets = 'initial' in input ? undefined : input.styleSheets;\n  Component = Component || lastAppProps.Component;\n  props = props || lastAppProps.props;\n  var appProps = (0, _extends2[\"default\"])({}, props, {\n    Component: Component,\n    err: err,\n    router: router\n  }); // lastAppProps has to be set before ReactDom.render to account for ReactDom throwing an error.\n\n  lastAppProps = appProps;\n  var canceled = false;\n  var resolvePromise;\n  var renderPromise = new Promise(function (resolve, reject) {\n    if (_lastRenderReject) {\n      _lastRenderReject();\n    }\n\n    resolvePromise = function resolvePromise() {\n      _lastRenderReject = null;\n      resolve();\n    };\n\n    _lastRenderReject = function lastRenderReject() {\n      canceled = true;\n      _lastRenderReject = null;\n      var error = new Error('Cancel rendering route');\n      error.cancelled = true;\n      reject(error);\n    };\n  }); // This function has a return type to ensure it doesn't start returning a\n  // Promise. It should remain synchronous.\n\n  function onStart() {\n    if (!styleSheets || // We use `style-loader` in development, so we don't need to do anything\n    // unless we're in production:\n    true) {\n      return false;\n    }\n\n    var currentStyleTags = looseToArray(document.querySelectorAll('style[data-n-href]'));\n    var currentHrefs = new Set(currentStyleTags.map(function (tag) {\n      return tag.getAttribute('data-n-href');\n    }));\n    var noscript = document.querySelector('noscript[data-n-css]');\n    var nonce = noscript == null ? void 0 : noscript.getAttribute('data-n-css');\n    styleSheets.forEach(function (_ref7) {\n      var href = _ref7.href,\n          text = _ref7.text;\n\n      if (!currentHrefs.has(href)) {\n        var styleTag = document.createElement('style');\n        styleTag.setAttribute('data-n-href', href);\n        styleTag.setAttribute('media', 'x');\n\n        if (nonce) {\n          styleTag.setAttribute('nonce', nonce);\n        }\n\n        document.head.appendChild(styleTag);\n        styleTag.appendChild(document.createTextNode(text));\n      }\n    });\n    return true;\n  }\n\n  function onHeadCommit() {\n    if ( // We use `style-loader` in development, so we don't need to do anything\n    // unless we're in production:\n    false && // We can skip this during hydration. Running it wont cause any harm, but\n    // we may as well save the CPU cycles:\n    styleSheets && // Ensure this render was not canceled\n    !canceled) {\n      var desiredHrefs = new Set(styleSheets.map(function (s) {\n        return s.href;\n      }));\n      var currentStyleTags = looseToArray(document.querySelectorAll('style[data-n-href]'));\n      var currentHrefs = currentStyleTags.map(function (tag) {\n        return tag.getAttribute('data-n-href');\n      }); // Toggle `<style>` tags on or off depending on if they're needed:\n\n      for (var idx = 0; idx < currentHrefs.length; ++idx) {\n        if (desiredHrefs.has(currentHrefs[idx])) {\n          currentStyleTags[idx].removeAttribute('media');\n        } else {\n          currentStyleTags[idx].setAttribute('media', 'x');\n        }\n      } // Reorder styles into intended order:\n\n\n      var referenceNode = document.querySelector('noscript[data-n-css]');\n\n      if ( // This should be an invariant:\n      referenceNode) {\n        styleSheets.forEach(function (_ref8) {\n          var href = _ref8.href;\n          var targetTag = document.querySelector(\"style[data-n-href=\\\"\".concat(href, \"\\\"]\"));\n\n          if ( // This should be an invariant:\n          targetTag) {\n            referenceNode.parentNode.insertBefore(targetTag, referenceNode.nextSibling);\n            referenceNode = targetTag;\n          }\n        });\n      } // Finally, clean up server rendered stylesheets:\n\n\n      looseToArray(document.querySelectorAll('link[data-n-p]')).forEach(function (el) {\n        el.parentNode.removeChild(el);\n      }); // Force browser to recompute layout, which should prevent a flash of\n      // unstyled content:\n\n      getComputedStyle(document.body, 'height');\n    }\n  }\n\n  function onRootCommit() {\n    resolvePromise();\n  }\n\n  var elem = /*#__PURE__*/_react[\"default\"].createElement(Root, {\n    callback: onRootCommit\n  }, /*#__PURE__*/_react[\"default\"].createElement(Head, {\n    callback: onHeadCommit\n  }), /*#__PURE__*/_react[\"default\"].createElement(AppContainer, null, /*#__PURE__*/_react[\"default\"].createElement(App, appProps)));\n\n  onStart(); // We catch runtime errors using componentDidCatch which will trigger renderError\n\n  renderReactElement(process.env.__NEXT_STRICT_MODE ? /*#__PURE__*/_react[\"default\"].createElement(_react[\"default\"].StrictMode, null, elem) : elem, appElement);\n  return renderPromise;\n}\n\nfunction Root(_ref9) {\n  _s();\n\n  var callback = _ref9.callback,\n      children = _ref9.children;\n\n  // We use `useLayoutEffect` to guarantee the callback is executed\n  // as soon as React flushes the update.\n  _react[\"default\"].useLayoutEffect(function () {\n    return callback();\n  }, [callback]);\n\n  if (process.env.__NEXT_TEST_MODE) {\n    // eslint-disable-next-line react-hooks/rules-of-hooks\n    _react[\"default\"].useEffect(function () {\n      window.__NEXT_HYDRATED = true;\n\n      if (window.__NEXT_HYDRATED_CB) {\n        window.__NEXT_HYDRATED_CB();\n      }\n    }, []);\n  } // We should ask to measure the Web Vitals after rendering completes so we\n  // don't cause any hydration delay:\n\n\n  _react[\"default\"].useEffect(function () {\n    (0, _performanceRelayer[\"default\"])(onPerfEntry);\n  }, []);\n\n  return children;\n} // Dummy component that we render as a child of Root so that we can\n// toggle the correct styles before the page is rendered.\n\n\n_s(Root, \"KDoBXdlwSU+O+uFsByO25XxhKDU=\");\n\n_c2 = Root;\n\nfunction Head(_ref10) {\n  _s2();\n\n  var callback = _ref10.callback;\n\n  // We use `useLayoutEffect` to guarantee the callback is executed\n  // as soon as React flushes the update.\n  _react[\"default\"].useLayoutEffect(function () {\n    return callback();\n  }, [callback]);\n\n  return null;\n}\n\n_s2(Head, \"n7/vCynhJvM+pLkyL2DMQUF0odM=\");\n\n_c3 = Head;\n\nvar _c, _c2, _c3;\n\n$RefreshReg$(_c, \"AppContainer\");\n$RefreshReg$(_c2, \"Root\");\n$RefreshReg$(_c3, \"Head\");","map":{"version":3,"sources":["../../client/index.tsx"],"names":["data","JSON","document","window","version","process","__NEXT_VERSION","looseToArray","props","err","locales","defaultLocale","prefix","__webpack_public_path__","envConfig","serverRuntimeConfig","publicRuntimeConfig","runtimeConfig","asPath","require","parsedAs","parseRelativeUrl","localePathResult","normalizeLocalePath","formatUrl","detectedDomain","detectDomainLocale","pageLoader","PageLoader","register","p","setTimeout","headManager","appElement","React","Component","componentDidMount","router","isFallback","location","hydrateProps","String","querystring","_h","shallow","componentDidUpdate","scrollToHash","hash","el","render","emitter","opts","webpackHMR","appEntrypoint","component","exports","CachedApp","mod","onPerfEntry","uniqueID","Date","Math","entries","perfStartEntry","id","name","startTime","value","label","entryType","initialErr","pageEntrypoint","error","CachedComponent","isValidElementType","node","getNodeError","initialProps","App","wrapApp","Boolean","subscription","Object","locale","initClientModule","initClientErr","console","renderCtx","initial","renderingProps","renderError","doRender","renderErr","styleSheets","onClientErrorModule","onClientErrorErr","page","AppTree","appCtx","ctx","pathname","query","Promise","renderErrorProps","initProps","reactRoot","shouldUseHydrate","ReactDOM","hydrate","ST","performance","clearMarks","navStartEntries","measure","mark","wrappedAppProps","appProps","input","lastAppProps","canceled","renderPromise","lastRenderReject","resolvePromise","resolve","reject","currentStyleTags","currentHrefs","tag","noscript","nonce","styleTag","desiredHrefs","s","idx","referenceNode","targetTag","getComputedStyle","elem","onStart","renderReactElement","callback"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAA,CAAA,uBAAA,CAAA;;AACA,IAAA,MAAA,GAAA,sBAAA,CAAA,OAAA,CAAA,OAAA,CAAA,CAAA;;AACA,IAAA,SAAA,GAAA,sBAAA,CAAA,OAAA,CAAA,WAAA,CAAA,CAAA;;AACA,IAAA,mBAAA,GAAA,OAAA,CAAA,yCAAA,CAAA;;AACA,IAAA,KAAA,GAAA,sBAAA,CAAA,OAAA,CAAA,yBAAA,CAAA,CAAA;;AACA,IAAA,cAAA,GAAA,OAAA,CAAA,mCAAA,CAAA;;AAOA,IAAA,OAAA,GAAA,OAAA,CAAA,kCAAA,CAAA;;AACA,IAAA,UAAA,GAAA,OAAA,CAAA,4CAAA,CAAA;;AACA,IAAA,WAAA,G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QAKwB;AAAA;;AAAA,MALV,QAKU,SALV,QAKU;AAAA,MALxB,QAKwB,SALxB,QAKwB;;AACtB;AACA;AACAzG,EAAAA,MAAAA,WAAAA,CAAAA,eAAAA,CAAsB;AAAA,WAAM0G,QAA5B1G,EAAsB;AAAA,GAAtBA,EAAwC,CAAxCA,QAAwC,CAAxCA;;AACA,MAAI7B,OAAO,CAAPA,GAAAA,CAAJ,gBAAA,EAAkC;AAChC;AACA6B,IAAAA,MAAAA,WAAAA,CAAAA,SAAAA,CAAgB,YAAM;AACpB/B,MAAAA,MAAM,CAANA,eAAAA,GAAAA,IAAAA;;AAEA,UAAIA,MAAM,CAAV,kBAAA,EAA+B;AAC7BA,QAAAA,MAAM,CAANA,kBAAAA;AAEH;AAND+B,KAAAA,EAAAA,EAAAA;AAQF,GAdsB,CActB;AACA;;;AACAA,EAAAA,MAAAA,WAAAA,CAAAA,SAAAA,CAAgB,YAAM;AACpB,KAAA,GAAA,mBAAA,WAAA,EAAA,WAAA;AADFA,GAAAA,EAAAA,EAAAA;;AAGA,SAAA,QAAA;AAGF,C,CAAA;AACA;;;GA5BA,I;;MAAA,I;;AA6BA,SAAA,IAAA,SAAsD;AAAA;;AAAA,MAAtD,QAAsD,UAAtD,QAAsD;;AACpD;AACA;AACAA,EAAAA,MAAAA,WAAAA,CAAAA,eAAAA,CAAsB;AAAA,WAAM0G,QAA5B1G,EAAsB;AAAA,GAAtBA,EAAwC,CAAxCA,QAAwC,CAAxCA;;AACA,SAAA,IAAA;AACD;;IALD,I;;MAAA,I","sourcesContent":["/* global location */\nimport '@next/polyfill-module'\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { HeadManagerContext } from '../next-server/lib/head-manager-context'\nimport mitt from '../next-server/lib/mitt'\nimport { RouterContext } from '../next-server/lib/router-context'\nimport type Router from '../next-server/lib/router/router'\nimport type {\n  AppComponent,\n  AppProps,\n  PrivateRouteInfo,\n} from '../next-server/lib/router/router'\nimport { delBasePath, hasBasePath } from '../next-server/lib/router/router'\nimport { isDynamicRoute } from '../next-server/lib/router/utils/is-dynamic'\nimport * as querystring from '../next-server/lib/router/utils/querystring'\nimport * as envConfig from '../next-server/lib/runtime-config'\nimport type { NEXT_DATA } from '../next-server/lib/utils'\nimport { getURL, loadGetInitialProps, ST } from '../next-server/lib/utils'\nimport initHeadManager from './head-manager'\nimport PageLoader, { StyleSheetTuple } from './page-loader'\nimport measureWebVitals from './performance-relayer'\nimport { createRouter, makePublicRouterInstance } from './router'\n\n/// <reference types=\"react-dom/experimental\" />\n\ndeclare let __webpack_public_path__: string\n\ndeclare global {\n  interface Window {\n    /* test fns */\n    __NEXT_HYDRATED?: boolean\n    __NEXT_HYDRATED_CB?: () => void\n\n    /* prod */\n    __NEXT_PRELOADREADY?: (ids?: string[]) => void\n    __NEXT_DATA__: NEXT_DATA\n    __NEXT_P: any[]\n  }\n}\n\ntype RenderRouteInfo = PrivateRouteInfo & { App: AppComponent }\ntype RenderErrorProps = Omit<RenderRouteInfo, 'Component' | 'styleSheets'>\n\nconst data: typeof window['__NEXT_DATA__'] = JSON.parse(\n  document.getElementById('__NEXT_DATA__')!.textContent!\n)\nwindow.__NEXT_DATA__ = data\n\nexport const version = process.env.__NEXT_VERSION\n\nconst looseToArray = <T extends {}>(input: any): T[] => [].slice.call(input)\n\nconst {\n  props: hydrateProps,\n  err: hydrateErr,\n  page,\n  query,\n  buildId,\n  assetPrefix,\n  runtimeConfig,\n  dynamicIds,\n  isFallback,\n  locales,\n} = data\n\nlet { locale, defaultLocale } = data\n\nconst prefix = assetPrefix || ''\n\n// With dynamic assetPrefix it's no longer possible to set assetPrefix at the build time\n// So, this is how we do it in the client side at runtime\n__webpack_public_path__ = `${prefix}/_next/` //eslint-disable-line\n// Initialize next/config with the environment configuration\nenvConfig.setConfig({\n  serverRuntimeConfig: {},\n  publicRuntimeConfig: runtimeConfig || {},\n})\n\nlet asPath = getURL()\n\n// make sure not to attempt stripping basePath for 404s\nif (hasBasePath(asPath)) {\n  asPath = delBasePath(asPath)\n}\n\nif (process.env.__NEXT_I18N_SUPPORT) {\n  const {\n    normalizeLocalePath,\n  } = require('../next-server/lib/i18n/normalize-locale-path') as typeof import('../next-server/lib/i18n/normalize-locale-path')\n\n  const {\n    detectDomainLocale,\n  } = require('../next-server/lib/i18n/detect-domain-locale') as typeof import('../next-server/lib/i18n/detect-domain-locale')\n\n  const {\n    parseRelativeUrl,\n  } = require('../next-server/lib/router/utils/parse-relative-url') as typeof import('../next-server/lib/router/utils/parse-relative-url')\n\n  const {\n    formatUrl,\n  } = require('../next-server/lib/router/utils/format-url') as typeof import('../next-server/lib/router/utils/format-url')\n\n  if (locales) {\n    const parsedAs = parseRelativeUrl(asPath)\n    const localePathResult = normalizeLocalePath(parsedAs.pathname, locales)\n\n    if (localePathResult.detectedLocale) {\n      parsedAs.pathname = localePathResult.pathname\n      asPath = formatUrl(parsedAs)\n    } else {\n      // derive the default locale if it wasn't detected in the asPath\n      // since we don't prerender static pages with all possible default\n      // locales\n      defaultLocale = locale\n    }\n\n    // attempt detecting default locale based on hostname\n    const detectedDomain = detectDomainLocale(\n      process.env.__NEXT_I18N_DOMAINS as any,\n      window.location.hostname\n    )\n\n    // TODO: investigate if defaultLocale needs to be populated after\n    // hydration to prevent mismatched renders\n    if (detectedDomain) {\n      defaultLocale = detectedDomain.defaultLocale\n    }\n  }\n}\n\ntype RegisterFn = (input: [string, () => void]) => void\n\nconst pageLoader = new PageLoader(buildId, prefix)\nconst register: RegisterFn = ([r, f]) =>\n  pageLoader.routeLoader.onEntrypoint(r, f)\nif (window.__NEXT_P) {\n  // Defer page registration for another tick. This will increase the overall\n  // latency in hydrating the page, but reduce the total blocking time.\n  window.__NEXT_P.map((p) => setTimeout(() => register(p), 0))\n}\nwindow.__NEXT_P = []\n;(window.__NEXT_P as any).push = register\n\nconst headManager = initHeadManager()\nconst appElement = document.getElementById('__next')\n\nlet lastAppProps: AppProps\nlet lastRenderReject: (() => void) | null\nlet webpackHMR: any\nexport let router: Router\nlet CachedComponent: React.ComponentType\nlet CachedApp: AppComponent, onPerfEntry: (metric: any) => void\n\nclass Container extends React.Component<{\n  fn: (err: Error, info?: any) => void\n}> {\n  componentDidCatch(componentErr: Error, info: any) {\n    this.props.fn(componentErr, info)\n  }\n\n  componentDidMount() {\n    this.scrollToHash()\n\n    // We need to replace the router state if:\n    // - the page was (auto) exported and has a query string or search (hash)\n    // - it was auto exported and is a dynamic route (to provide params)\n    // - if it is a client-side skeleton (fallback render)\n    if (\n      router.isSsr &&\n      (isFallback ||\n        (data.nextExport &&\n          (isDynamicRoute(router.pathname) || location.search)) ||\n        (hydrateProps && hydrateProps.__N_SSG && location.search))\n    ) {\n      // update query on mount for exported pages\n      router.replace(\n        router.pathname +\n          '?' +\n          String(\n            querystring.assign(\n              querystring.urlQueryToSearchParams(router.query),\n              new URLSearchParams(location.search)\n            )\n          ),\n        asPath,\n        {\n          // @ts-ignore\n          // WARNING: `_h` is an internal option for handing Next.js\n          // client-side hydration. Your app should _never_ use this property.\n          // It may change at any time without notice.\n          _h: 1,\n          // Fallback pages must trigger the data fetch, so the transition is\n          // not shallow.\n          // Other pages (strictly updating query) happens shallowly, as data\n          // requirements would already be present.\n          shallow: !isFallback,\n        }\n      )\n    }\n  }\n\n  componentDidUpdate() {\n    this.scrollToHash()\n  }\n\n  scrollToHash() {\n    let { hash } = location\n    hash = hash && hash.substring(1)\n    if (!hash) return\n\n    const el = document.getElementById(hash)\n    if (!el) return\n\n    // If we call scrollIntoView() in here without a setTimeout\n    // it won't scroll properly.\n    setTimeout(() => el.scrollIntoView(), 0)\n  }\n\n  render() {\n    if (process.env.NODE_ENV === 'production') {\n      return this.props.children\n    } else {\n      const { ReactDevOverlay } = require('@next/react-dev-overlay/lib/client')\n      return <ReactDevOverlay>{this.props.children}</ReactDevOverlay>\n    }\n  }\n}\n\nexport const emitter = mitt()\n\nexport default async (opts: { webpackHMR?: any } = {}) => {\n  // This makes sure this specific lines are removed in production\n  if (process.env.NODE_ENV === 'development') {\n    webpackHMR = opts.webpackHMR\n  }\n\n  const appEntrypoint = await pageLoader.routeLoader.whenEntrypoint('/_app')\n  if ('error' in appEntrypoint) {\n    throw appEntrypoint.error\n  }\n\n  const { component: app, exports: mod } = appEntrypoint\n  CachedApp = app as AppComponent\n\n  if (mod && mod.reportWebVitals) {\n    onPerfEntry = ({\n      id,\n      name,\n      startTime,\n      value,\n      duration,\n      entryType,\n      entries,\n    }) => {\n      // Combines timestamp with random number for unique ID\n      const uniqueID = `${Date.now()}-${\n        Math.floor(Math.random() * (9e12 - 1)) + 1e12\n      }`\n      let perfStartEntry\n\n      if (entries && entries.length) {\n        perfStartEntry = entries[0].startTime\n      }\n\n      mod.reportWebVitals({\n        id: id || uniqueID,\n        name,\n        startTime: startTime || perfStartEntry,\n        value: value == null ? duration : value,\n        label:\n          entryType === 'mark' || entryType === 'measure'\n            ? 'custom'\n            : 'web-vital',\n      })\n    }\n  }\n\n  let initialErr = hydrateErr\n\n  try {\n    const pageEntrypoint =\n      // The dev server fails to serve script assets when there's a hydration\n      // error, so we need to skip waiting for the entrypoint.\n      process.env.NODE_ENV === 'development' && hydrateErr\n        ? { error: hydrateErr }\n        : await pageLoader.routeLoader.whenEntrypoint(page)\n    if ('error' in pageEntrypoint) {\n      throw pageEntrypoint.error\n    }\n    CachedComponent = pageEntrypoint.component\n\n    if (process.env.NODE_ENV !== 'production') {\n      const { isValidElementType } = require('react-is')\n      if (!isValidElementType(CachedComponent)) {\n        throw new Error(\n          `The default export is not a React Component in page: \"${page}\"`\n        )\n      }\n    }\n  } catch (error) {\n    // This catches errors like throwing in the top level of a module\n    initialErr = error\n  }\n\n  if (process.env.NODE_ENV === 'development') {\n    const { getNodeError } = require('@next/react-dev-overlay/lib/client')\n    // Server-side runtime errors need to be re-thrown on the client-side so\n    // that the overlay is rendered.\n    if (initialErr) {\n      if (initialErr === hydrateErr) {\n        setTimeout(() => {\n          let error\n          try {\n            // Generate a new error object. We `throw` it because some browsers\n            // will set the `stack` when thrown, and we want to ensure ours is\n            // not overridden when we re-throw it below.\n            throw new Error(initialErr!.message)\n          } catch (e) {\n            error = e\n          }\n\n          error.name = initialErr!.name\n          error.stack = initialErr!.stack\n\n          const node = getNodeError(error)\n          throw node\n        })\n      }\n      // We replaced the server-side error with a client-side error, and should\n      // no longer rewrite the stack trace to a Node error.\n      else {\n        setTimeout(() => {\n          throw initialErr\n        })\n      }\n    }\n  }\n\n  if (window.__NEXT_PRELOADREADY) {\n    await window.__NEXT_PRELOADREADY(dynamicIds)\n  }\n\n  router = createRouter(page, query, asPath, {\n    initialProps: hydrateProps,\n    pageLoader,\n    App: CachedApp,\n    Component: CachedComponent,\n    wrapApp,\n    err: initialErr,\n    isFallback: Boolean(isFallback),\n    subscription: (info, App) => render(Object.assign({}, info, { App })),\n    locale,\n    locales,\n    defaultLocale,\n  })\n\n  // call init-client middleware\n  if (process.env.__NEXT_PLUGINS) {\n    // @ts-ignore\n    // eslint-disable-next-line\n    import('next-plugin-loader?middleware=on-init-client!')\n      .then((initClientModule) => {\n        return initClientModule.default({ router })\n      })\n      .catch((initClientErr) => {\n        console.error('Error calling client-init for plugins', initClientErr)\n      })\n  }\n\n  const renderCtx: RenderRouteInfo = {\n    App: CachedApp,\n    initial: true,\n    Component: CachedComponent,\n    props: hydrateProps,\n    err: initialErr,\n  }\n\n  if (process.env.NODE_ENV === 'production') {\n    render(renderCtx)\n    return emitter\n  } else {\n    return { emitter, render, renderCtx }\n  }\n}\n\nexport async function render(renderingProps: RenderRouteInfo) {\n  if (renderingProps.err) {\n    await renderError(renderingProps)\n    return\n  }\n\n  try {\n    await doRender(renderingProps)\n  } catch (renderErr) {\n    // bubble up cancelation errors\n    if (renderErr.cancelled) {\n      throw renderErr\n    }\n\n    if (process.env.NODE_ENV === 'development') {\n      // Ensure this error is displayed in the overlay in development\n      setTimeout(() => {\n        throw renderErr\n      })\n    }\n    await renderError({ ...renderingProps, err: renderErr })\n  }\n}\n\n// This method handles all runtime and debug errors.\n// 404 and 500 errors are special kind of errors\n// and they are still handle via the main render method.\nexport function renderError(renderErrorProps: RenderErrorProps) {\n  const { App, err } = renderErrorProps\n\n  // In development runtime errors are caught by our overlay\n  // In production we catch runtime errors using componentDidCatch which will trigger renderError\n  if (process.env.NODE_ENV !== 'production') {\n    // A Next.js rendering runtime error is always unrecoverable\n    // FIXME: let's make this recoverable (error in GIP client-transition)\n    webpackHMR.onUnrecoverableError()\n\n    // We need to render an empty <App> so that the `<ReactDevOverlay>` can\n    // render itself.\n    return doRender({\n      App: () => null,\n      props: {},\n      Component: () => null,\n      styleSheets: [],\n    })\n  }\n  if (process.env.__NEXT_PLUGINS) {\n    // @ts-ignore\n    // eslint-disable-next-line\n    import('next-plugin-loader?middleware=on-error-client!')\n      .then((onClientErrorModule) => {\n        return onClientErrorModule.default({ err })\n      })\n      .catch((onClientErrorErr) => {\n        console.error(\n          'error calling on-error-client for plugins',\n          onClientErrorErr\n        )\n      })\n  }\n\n  // Make sure we log the error to the console, otherwise users can't track down issues.\n  console.error(err)\n  return pageLoader\n    .loadPage('/_error')\n    .then(({ page: ErrorComponent, styleSheets }) => {\n      // In production we do a normal render with the `ErrorComponent` as component.\n      // If we've gotten here upon initial render, we can use the props from the server.\n      // Otherwise, we need to call `getInitialProps` on `App` before mounting.\n      const AppTree = wrapApp(App)\n      const appCtx = {\n        Component: ErrorComponent,\n        AppTree,\n        router,\n        ctx: { err, pathname: page, query, asPath, AppTree },\n      }\n      return Promise.resolve(\n        renderErrorProps.props\n          ? renderErrorProps.props\n          : loadGetInitialProps(App, appCtx)\n      ).then((initProps) =>\n        doRender({\n          ...renderErrorProps,\n          err,\n          Component: ErrorComponent,\n          styleSheets,\n          props: initProps,\n        })\n      )\n    })\n}\n\nlet reactRoot: any = null\nlet shouldUseHydrate = typeof ReactDOM.hydrate === 'function'\nfunction renderReactElement(reactEl: JSX.Element, domEl: HTMLElement) {\n  if (process.env.__NEXT_REACT_MODE !== 'legacy') {\n    if (!reactRoot) {\n      const opts = { hydrate: true }\n      reactRoot =\n        process.env.__NEXT_REACT_MODE === 'concurrent'\n          ? (ReactDOM as any).unstable_createRoot(domEl, opts)\n          : (ReactDOM as any).unstable_createBlockingRoot(domEl, opts)\n    }\n    reactRoot.render(reactEl)\n  } else {\n    // mark start of hydrate/render\n    if (ST) {\n      performance.mark('beforeRender')\n    }\n\n    // The check for `.hydrate` is there to support React alternatives like preact\n    if (shouldUseHydrate) {\n      ReactDOM.hydrate(reactEl, domEl, markHydrateComplete)\n      shouldUseHydrate = false\n    } else {\n      ReactDOM.render(reactEl, domEl, markRenderComplete)\n    }\n  }\n}\n\nfunction markHydrateComplete() {\n  if (!ST) return\n\n  performance.mark('afterHydrate') // mark end of hydration\n\n  performance.measure(\n    'Next.js-before-hydration',\n    'navigationStart',\n    'beforeRender'\n  )\n  performance.measure('Next.js-hydration', 'beforeRender', 'afterHydrate')\n\n  if (onPerfEntry) {\n    performance.getEntriesByName('Next.js-hydration').forEach(onPerfEntry)\n  }\n  clearMarks()\n}\n\nfunction markRenderComplete() {\n  if (!ST) return\n\n  performance.mark('afterRender') // mark end of render\n  const navStartEntries = performance.getEntriesByName('routeChange', 'mark')\n\n  if (!navStartEntries.length) {\n    return\n  }\n\n  performance.measure(\n    'Next.js-route-change-to-render',\n    navStartEntries[0].name,\n    'beforeRender'\n  )\n  performance.measure('Next.js-render', 'beforeRender', 'afterRender')\n  if (onPerfEntry) {\n    performance.getEntriesByName('Next.js-render').forEach(onPerfEntry)\n    performance\n      .getEntriesByName('Next.js-route-change-to-render')\n      .forEach(onPerfEntry)\n  }\n  clearMarks()\n  ;['Next.js-route-change-to-render', 'Next.js-render'].forEach((measure) =>\n    performance.clearMeasures(measure)\n  )\n}\n\nfunction clearMarks() {\n  ;[\n    'beforeRender',\n    'afterHydrate',\n    'afterRender',\n    'routeChange',\n  ].forEach((mark) => performance.clearMarks(mark))\n}\n\nfunction AppContainer({\n  children,\n}: React.PropsWithChildren<{}>): React.ReactElement {\n  return (\n    <Container\n      fn={(error) =>\n        renderError({ App: CachedApp, err: error }).catch((err) =>\n          console.error('Error rendering page: ', err)\n        )\n      }\n    >\n      <RouterContext.Provider value={makePublicRouterInstance(router)}>\n        <HeadManagerContext.Provider value={headManager}>\n          {children}\n        </HeadManagerContext.Provider>\n      </RouterContext.Provider>\n    </Container>\n  )\n}\n\nconst wrapApp = (App: AppComponent) => (\n  wrappedAppProps: Record<string, any>\n) => {\n  const appProps: AppProps = {\n    ...wrappedAppProps,\n    Component: CachedComponent,\n    err: hydrateErr,\n    router,\n  }\n  return (\n    <AppContainer>\n      <App {...appProps} />\n    </AppContainer>\n  )\n}\n\nfunction doRender(input: RenderRouteInfo): Promise<any> {\n  let { App, Component, props, err } = input\n  let styleSheets: StyleSheetTuple[] | undefined =\n    'initial' in input ? undefined : input.styleSheets\n  Component = Component || lastAppProps.Component\n  props = props || lastAppProps.props\n\n  const appProps: AppProps = {\n    ...props,\n    Component,\n    err,\n    router,\n  }\n  // lastAppProps has to be set before ReactDom.render to account for ReactDom throwing an error.\n  lastAppProps = appProps\n\n  let canceled = false\n  let resolvePromise: () => void\n  const renderPromise = new Promise((resolve, reject) => {\n    if (lastRenderReject) {\n      lastRenderReject()\n    }\n    resolvePromise = () => {\n      lastRenderReject = null\n      resolve()\n    }\n    lastRenderReject = () => {\n      canceled = true\n      lastRenderReject = null\n\n      const error: any = new Error('Cancel rendering route')\n      error.cancelled = true\n      reject(error)\n    }\n  })\n\n  // This function has a return type to ensure it doesn't start returning a\n  // Promise. It should remain synchronous.\n  function onStart(): boolean {\n    if (\n      !styleSheets ||\n      // We use `style-loader` in development, so we don't need to do anything\n      // unless we're in production:\n      process.env.NODE_ENV !== 'production'\n    ) {\n      return false\n    }\n\n    const currentStyleTags = looseToArray<HTMLStyleElement>(\n      document.querySelectorAll('style[data-n-href]')\n    )\n    const currentHrefs = new Set(\n      currentStyleTags.map((tag) => tag.getAttribute('data-n-href'))\n    )\n\n    const noscript = document.querySelector('noscript[data-n-css]')\n    const nonce = noscript?.getAttribute('data-n-css')\n\n    styleSheets.forEach(({ href, text }) => {\n      if (!currentHrefs.has(href)) {\n        const styleTag = document.createElement('style')\n        styleTag.setAttribute('data-n-href', href)\n        styleTag.setAttribute('media', 'x')\n\n        if (nonce) {\n          styleTag.setAttribute('nonce', nonce)\n        }\n\n        document.head.appendChild(styleTag)\n        styleTag.appendChild(document.createTextNode(text))\n      }\n    })\n    return true\n  }\n\n  function onHeadCommit() {\n    if (\n      // We use `style-loader` in development, so we don't need to do anything\n      // unless we're in production:\n      process.env.NODE_ENV === 'production' &&\n      // We can skip this during hydration. Running it wont cause any harm, but\n      // we may as well save the CPU cycles:\n      styleSheets &&\n      // Ensure this render was not canceled\n      !canceled\n    ) {\n      const desiredHrefs = new Set(styleSheets.map((s) => s.href))\n      const currentStyleTags = looseToArray<HTMLStyleElement>(\n        document.querySelectorAll('style[data-n-href]')\n      )\n      const currentHrefs = currentStyleTags.map(\n        (tag) => tag.getAttribute('data-n-href')!\n      )\n\n      // Toggle `<style>` tags on or off depending on if they're needed:\n      for (let idx = 0; idx < currentHrefs.length; ++idx) {\n        if (desiredHrefs.has(currentHrefs[idx])) {\n          currentStyleTags[idx].removeAttribute('media')\n        } else {\n          currentStyleTags[idx].setAttribute('media', 'x')\n        }\n      }\n\n      // Reorder styles into intended order:\n      let referenceNode = document.querySelector('noscript[data-n-css]')\n      if (\n        // This should be an invariant:\n        referenceNode\n      ) {\n        styleSheets.forEach(({ href }) => {\n          const targetTag = document.querySelector(\n            `style[data-n-href=\"${href}\"]`\n          )\n          if (\n            // This should be an invariant:\n            targetTag\n          ) {\n            referenceNode!.parentNode!.insertBefore(\n              targetTag,\n              referenceNode!.nextSibling\n            )\n            referenceNode = targetTag\n          }\n        })\n      }\n\n      // Finally, clean up server rendered stylesheets:\n      looseToArray<HTMLLinkElement>(\n        document.querySelectorAll('link[data-n-p]')\n      ).forEach((el) => {\n        el.parentNode!.removeChild(el)\n      })\n\n      // Force browser to recompute layout, which should prevent a flash of\n      // unstyled content:\n      getComputedStyle(document.body, 'height')\n    }\n  }\n\n  function onRootCommit() {\n    resolvePromise()\n  }\n\n  const elem = (\n    <Root callback={onRootCommit}>\n      <Head callback={onHeadCommit} />\n      <AppContainer>\n        <App {...appProps} />\n      </AppContainer>\n    </Root>\n  )\n\n  onStart()\n\n  // We catch runtime errors using componentDidCatch which will trigger renderError\n  renderReactElement(\n    process.env.__NEXT_STRICT_MODE ? (\n      <React.StrictMode>{elem}</React.StrictMode>\n    ) : (\n      elem\n    ),\n    appElement!\n  )\n\n  return renderPromise\n}\n\nfunction Root({\n  callback,\n  children,\n}: React.PropsWithChildren<{\n  callback: () => void\n}>): React.ReactElement {\n  // We use `useLayoutEffect` to guarantee the callback is executed\n  // as soon as React flushes the update.\n  React.useLayoutEffect(() => callback(), [callback])\n  if (process.env.__NEXT_TEST_MODE) {\n    // eslint-disable-next-line react-hooks/rules-of-hooks\n    React.useEffect(() => {\n      window.__NEXT_HYDRATED = true\n\n      if (window.__NEXT_HYDRATED_CB) {\n        window.__NEXT_HYDRATED_CB()\n      }\n    }, [])\n  }\n  // We should ask to measure the Web Vitals after rendering completes so we\n  // don't cause any hydration delay:\n  React.useEffect(() => {\n    measureWebVitals(onPerfEntry)\n  }, [])\n  return children as React.ReactElement\n}\n\n// Dummy component that we render as a child of Root so that we can\n// toggle the correct styles before the page is rendered.\nfunction Head({ callback }: { callback: () => void }) {\n  // We use `useLayoutEffect` to guarantee the callback is executed\n  // as soon as React flushes the update.\n  React.useLayoutEffect(() => callback(), [callback])\n  return null\n}\n"]},"metadata":{},"sourceType":"script"}