|
- {"ast":null,"code":"\"use strict\";\n\nvar _classCallCheck = require(\"@babel/runtime/helpers/classCallCheck\");\n\nvar _createClass = require(\"@babel/runtime/helpers/createClass\");\n\nvar _inherits = require(\"@babel/runtime/helpers/inherits\");\n\nvar _possibleConstructorReturn = require(\"@babel/runtime/helpers/possibleConstructorReturn\");\n\nvar _getPrototypeOf = require(\"@babel/runtime/helpers/getPrototypeOf\");\n\nvar _regeneratorRuntime = require(\"@babel/runtime/regenerator\");\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 { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.Container = Container;\nexports.createUrl = createUrl;\nexports[\"default\"] = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _utils = require(\"../next-server/lib/utils\");\n\nexports.AppInitialProps = _utils.AppInitialProps;\n/**\n* `App` component is used for initialize of pages. It allows for overwriting and full control of the `page` initialization.\n* This allows for keeping state between navigation, custom error handling, injecting additional data.\n*/\n\nfunction appGetInitialProps(_ref) {\n var Component, ctx, pageProps;\n return _regeneratorRuntime.async(function appGetInitialProps$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n Component = _ref.Component, ctx = _ref.ctx;\n _context.next = 3;\n return _regeneratorRuntime.awrap((0, _utils.loadGetInitialProps)(Component, ctx));\n\n case 3:\n pageProps = _context.sent;\n return _context.abrupt(\"return\", {\n pageProps: pageProps\n });\n\n case 5:\n case \"end\":\n return _context.stop();\n }\n }\n }, null, null, null, Promise);\n}\n\nvar App = /*#__PURE__*/function (_react$default$Compon) {\n _inherits(App, _react$default$Compon);\n\n var _super = _createSuper(App);\n\n function App() {\n _classCallCheck(this, App);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(App, [{\n key: \"componentDidCatch\",\n value: // Kept here for backwards compatibility.\n // When someone ended App they could call `super.componentDidCatch`.\n // @deprecated This method is no longer needed. Errors are caught at the top level\n function componentDidCatch(error, _errorInfo) {\n throw error;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n router = _this$props.router,\n Component = _this$props.Component,\n pageProps = _this$props.pageProps,\n __N_SSG = _this$props.__N_SSG,\n __N_SSP = _this$props.__N_SSP;\n return _react[\"default\"].createElement(Component, Object.assign({}, pageProps, // we don't add the legacy URL prop if it's using non-legacy\n // methods like getStaticProps and getServerSideProps\n !(__N_SSG || __N_SSP) ? {\n url: createUrl(router)\n } : {}));\n }\n }]);\n\n return App;\n}(_react[\"default\"].Component);\n\nexports[\"default\"] = App;\nApp.origGetInitialProps = appGetInitialProps;\nApp.getInitialProps = appGetInitialProps;\nvar warnContainer;\nvar warnUrl;\n\nif (false) {\n warnContainer = (0, _utils.execOnce)(function () {\n console.warn(\"Warning: the `Container` in `_app` has been deprecated and should be removed. https://err.sh/zeit/next.js/app-container-deprecated\");\n });\n warnUrl = (0, _utils.execOnce)(function () {\n console.error(\"Warning: the 'url' property is deprecated. https://err.sh/zeit/next.js/url-deprecated\");\n });\n} // @deprecated noop for now until removal\n\n\nfunction Container(p) {\n if (false) warnContainer();\n return p.children;\n}\n\nfunction createUrl(router) {\n // This is to make sure we don't references the router object at call time\n var pathname = router.pathname,\n asPath = router.asPath,\n query = router.query;\n return {\n get query() {\n if (false) warnUrl();\n return query;\n },\n\n get pathname() {\n if (false) warnUrl();\n return pathname;\n },\n\n get asPath() {\n if (false) warnUrl();\n return asPath;\n },\n\n back: function back() {\n if (false) warnUrl();\n router.back();\n },\n push: function push(url, as) {\n if (false) warnUrl();\n return router.push(url, as);\n },\n pushTo: function pushTo(href, as) {\n if (false) warnUrl();\n var pushRoute = as ? href : '';\n var pushUrl = as || href;\n return router.push(pushRoute, pushUrl);\n },\n replace: function replace(url, as) {\n if (false) warnUrl();\n return router.replace(url, as);\n },\n replaceTo: function replaceTo(href, as) {\n if (false) warnUrl();\n var replaceRoute = as ? href : '';\n var replaceUrl = as || href;\n return router.replace(replaceRoute, replaceUrl);\n }\n };\n}","map":null,"metadata":{},"sourceType":"script"}
|