UNPKG

cl-react-graph

Version:
1,197 lines (1,022 loc) 4.74 MB
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("/home/rob/cl-react-graph/docs-src/node_modules/@reach/router/index.js"), require("fs"), require("http"), require("https"), require("/home/rob/cl-react-graph/docs-src/node_modules/gatsby/node_modules/lodash/merge.js"), require("path"), require("react"), require("react-dom/server"), require("react-helmet")); else if(typeof define === 'function' && define.amd) define("lib", ["/home/rob/cl-react-graph/docs-src/node_modules/@reach/router/index.js", "fs", "http", "https", "/home/rob/cl-react-graph/docs-src/node_modules/gatsby/node_modules/lodash/merge.js", "path", "react", "react-dom/server", "react-helmet"], factory); else if(typeof exports === 'object') exports["lib"] = factory(require("/home/rob/cl-react-graph/docs-src/node_modules/@reach/router/index.js"), require("fs"), require("http"), require("https"), require("/home/rob/cl-react-graph/docs-src/node_modules/gatsby/node_modules/lodash/merge.js"), require("path"), require("react"), require("react-dom/server"), require("react-helmet")); else root["lib"] = factory(root["/home/rob/cl-react-graph/docs-src/node_modules/@reach/router/index.js"], root["fs"], root["http"], root["https"], root["/home/rob/cl-react-graph/docs-src/node_modules/gatsby/node_modules/lodash/merge.js"], root["path"], root["react"], root["react-dom/server"], root["react-helmet"]); })(this, function(__WEBPACK_EXTERNAL_MODULE__reach_router__, __WEBPACK_EXTERNAL_MODULE_fs__, __WEBPACK_EXTERNAL_MODULE_http__, __WEBPACK_EXTERNAL_MODULE_https__, __WEBPACK_EXTERNAL_MODULE_lodash_merge__, __WEBPACK_EXTERNAL_MODULE_path__, __WEBPACK_EXTERNAL_MODULE_react__, __WEBPACK_EXTERNAL_MODULE_react_dom_server__, __WEBPACK_EXTERNAL_MODULE_react_helmet__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/"; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "./.cache/develop-static-entry.js"); /******/ }) /************************************************************************/ /******/ ({ /***/ "./.cache/api-runner-ssr.js": /*!**********************************!*\ !*** ./.cache/api-runner-ssr.js ***! \**********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var plugins = [{ plugin: __webpack_require__(/*! ./node_modules/gatsby-plugin-react-helmet/gatsby-ssr */ "./node_modules/gatsby-plugin-react-helmet/gatsby-ssr.js"), options: { "plugins": [] } }, { plugin: __webpack_require__(/*! ./node_modules/gatsby-plugin-manifest/gatsby-ssr */ "./node_modules/gatsby-plugin-manifest/gatsby-ssr.js"), options: { "plugins": [], "name": "gatsby-starter-default", "short_name": "starter", "start_url": "/", "background_color": "#56b4bf", "theme_color": "#56b4bf", "display": "minimal-ui", "icon": "src/images/gatsby-icon.png", "legacy": true, "theme_color_in_head": true, "cache_busting_mode": "query", "crossOrigin": "anonymous", "include_favicon": true, "cacheDigest": "4a9773549091c227cd2eb82ccd9c5e3a" } }, { plugin: __webpack_require__(/*! ./node_modules/gatsby-plugin-material-ui/gatsby-ssr */ "./node_modules/gatsby-plugin-material-ui/gatsby-ssr.js"), options: { "plugins": [], "dangerouslyUseGlobalCSS": true, "theme": { "palette": { "primary": { "main": "#00a97b" }, "secondary": { "main": "#27626a" } } } } }]; // During bootstrap, we write requires at top of this file which looks like: // var plugins = [ // { // plugin: require("/path/to/plugin1/gatsby-ssr.js"), // options: { ... }, // }, // { // plugin: require("/path/to/plugin2/gatsby-ssr.js"), // options: { ... }, // }, // ] var apis = __webpack_require__(/*! ./api-ssr-docs */ "./.cache/api-ssr-docs.js"); // Run the specified API in any plugins that have implemented it module.exports = function (api, args, defaultReturn, argTransform) { if (!apis[api]) { console.log("This API doesn't exist", api); } // Run each plugin in series. // eslint-disable-next-line no-undef var results = plugins.map(function (plugin) { if (!plugin.plugin[api]) { return undefined; } var result = plugin.plugin[api](args, plugin.options); if (result && argTransform) { args = argTransform({ args: args, result: result }); } return result; }); // Filter out undefined results. results = results.filter(function (result) { return typeof result !== "undefined"; }); if (results.length > 0) { return results; } else { return [defaultReturn]; } }; /***/ }), /***/ "./.cache/api-ssr-docs.js": /*!********************************!*\ !*** ./.cache/api-ssr-docs.js ***! \********************************/ /*! no static exports found */ /***/ (function(module, exports) { /** * Object containing options defined in `gatsby-config.js` * @typedef {object} pluginOptions */ /** * Replace the default server renderer. This is useful for integration with * Redux, css-in-js libraries, etc. that need custom setups for server * rendering. * @param {object} $0 * @param {string} $0.pathname The pathname of the page currently being rendered. * @param {ReactNode} $0.bodyComponent The React element to be rendered as the page body * @param {function} $0.replaceBodyHTMLString Call this with the HTML string * you render. **WARNING** if multiple plugins implement this API it's the * last plugin that "wins". TODO implement an automated warning against this. * @param {function} $0.setHeadComponents Takes an array of components as its * first argument which are added to the `headComponents` array which is passed * to the `html.js` component. * @param {function} $0.setHtmlAttributes Takes an object of props which will * spread into the `<html>` component. * @param {function} $0.setBodyAttributes Takes an object of props which will * spread into the `<body>` component. * @param {function} $0.setPreBodyComponents Takes an array of components as its * first argument which are added to the `preBodyComponents` array which is passed * to the `html.js` component. * @param {function} $0.setPostBodyComponents Takes an array of components as its * first argument which are added to the `postBodyComponents` array which is passed * to the `html.js` component. * @param {function} $0.setBodyProps Takes an object of data which * is merged with other body props and passed to `html.js` as `bodyProps`. * @param {pluginOptions} pluginOptions * @example * // From gatsby-plugin-glamor * const { renderToString } = require("react-dom/server") * const inline = require("glamor-inline") * * exports.replaceRenderer = ({ bodyComponent, replaceBodyHTMLString }) => { * const bodyHTML = renderToString(bodyComponent) * const inlinedHTML = inline(bodyHTML) * * replaceBodyHTMLString(inlinedHTML) * } */ exports.replaceRenderer = true; /** * Called after every page Gatsby server renders while building HTML so you can * set head and body components to be rendered in your `html.js`. * * Gatsby does a two-pass render for HTML. It loops through your pages first * rendering only the body and then takes the result body HTML string and * passes it as the `body` prop to your `html.js` to complete the render. * * It's often handy to be able to send custom components to your `html.js`. * For example, it's a very common pattern for React.js libraries that * support server rendering to pull out data generated during the render to * add to your HTML. * * Using this API over [`replaceRenderer`](#replaceRenderer) is preferable as * multiple plugins can implement this API where only one plugin can take * over server rendering. However, if your plugin requires taking over server * rendering then that's the one to * use * @param {object} $0 * @param {string} $0.pathname The pathname of the page currently being rendered. * @param {function} $0.setHeadComponents Takes an array of components as its * first argument which are added to the `headComponents` array which is passed * to the `html.js` component. * @param {function} $0.setHtmlAttributes Takes an object of props which will * spread into the `<html>` component. * @param {function} $0.setBodyAttributes Takes an object of props which will * spread into the `<body>` component. * @param {function} $0.setPreBodyComponents Takes an array of components as its * first argument which are added to the `preBodyComponents` array which is passed * to the `html.js` component. * @param {function} $0.setPostBodyComponents Takes an array of components as its * first argument which are added to the `postBodyComponents` array which is passed * to the `html.js` component. * @param {function} $0.setBodyProps Takes an object of data which * is merged with other body props and passed to `html.js` as `bodyProps`. * @param {pluginOptions} pluginOptions * @example * // Import React so that you can use JSX in HeadComponents * const React = require("react") * * const HtmlAttributes = { * lang: "en" * } * * const HeadComponents = [ * <script key="my-script" src="https://gatsby.dev/my-script" /> * ] * * const BodyAttributes = { * "data-theme": "dark" * } * * exports.onRenderBody = ({ * setHeadComponents, * setHtmlAttributes, * setBodyAttributes * }, pluginOptions) => { * setHtmlAttributes(HtmlAttributes) * setHeadComponents(HeadComponents) * setBodyAttributes(BodyAttributes) * } */ exports.onRenderBody = true; /** * Called after every page Gatsby server renders while building HTML so you can * replace head components to be rendered in your `html.js`. This is useful if * you need to reorder scripts or styles added by other plugins. * @param {object} $0 * @param {string} $0.pathname The pathname of the page currently being rendered. * @param {Array<ReactNode>} $0.getHeadComponents Returns the current `headComponents` array. * @param {function} $0.replaceHeadComponents Takes an array of components as its * first argument which replace the `headComponents` array which is passed * to the `html.js` component. **WARNING** if multiple plugins implement this * API it's the last plugin that "wins". * @param {Array<ReactNode>} $0.getPreBodyComponents Returns the current `preBodyComponents` array. * @param {function} $0.replacePreBodyComponents Takes an array of components as its * first argument which replace the `preBodyComponents` array which is passed * to the `html.js` component. **WARNING** if multiple plugins implement this * API it's the last plugin that "wins". * @param {Array<ReactNode>} $0.getPostBodyComponents Returns the current `postBodyComponents` array. * @param {function} $0.replacePostBodyComponents Takes an array of components as its * first argument which replace the `postBodyComponents` array which is passed * to the `html.js` component. **WARNING** if multiple plugins implement this * API it's the last plugin that "wins". * @param {pluginOptions} pluginOptions * @example * // Move Typography.js styles to the top of the head section so they're loaded first. * exports.onPreRenderHTML = ({ getHeadComponents, replaceHeadComponents }) => { * const headComponents = getHeadComponents() * headComponents.sort((x, y) => { * if (x.key === 'TypographyStyle') { * return -1 * } else if (y.key === 'TypographyStyle') { * return 1 * } * return 0 * }) * replaceHeadComponents(headComponents) * } */ exports.onPreRenderHTML = true; /** * Allow a plugin to wrap the page element. * * This is useful for setting wrapper components around pages that won't get * unmounted on page changes. For setting Provider components, use [wrapRootElement](#wrapRootElement). * * _Note:_ * There is an equivalent hook in Gatsby's [Browser API](/docs/browser-apis/#wrapPageElement). * It is recommended to use both APIs together. * For example usage, check out [Using i18n](https://github.com/gatsbyjs/gatsby/tree/master/examples/using-i18n). * @param {object} $0 * @param {ReactNode} $0.element The "Page" React Element built by Gatsby. * @param {object} $0.props Props object used by page. * @param {pluginOptions} pluginOptions * @returns {ReactNode} Wrapped element * @example * const React = require("react") * const Layout = require("./src/components/layout").default * * exports.wrapPageElement = ({ element, props }) => { * // props provide same data to Layout as Page element will get * // including location, data, etc - you don't need to pass it * return <Layout {...props}>{element}</Layout> * } */ exports.wrapPageElement = true; /** * Allow a plugin to wrap the root element. * * This is useful to set up any Provider components that will wrap your application. * For setting persistent UI elements around pages use [wrapPageElement](#wrapPageElement). * * _Note:_ * There is an equivalent hook in Gatsby's [Browser API](/docs/browser-apis/#wrapRootElement). * It is recommended to use both APIs together. * For example usage, check out [Using redux](https://github.com/gatsbyjs/gatsby/tree/master/examples/using-redux). * @param {object} $0 * @param {ReactNode} $0.element The "Root" React Element built by Gatsby. * @param {pluginOptions} pluginOptions * @returns {ReactNode} Wrapped element * @example * const React = require("react") * const { Provider } = require("react-redux") * * const createStore = require("./src/state/createStore") * const store = createStore() * * exports.wrapRootElement = ({ element }) => { * return ( * <Provider store={store}> * {element} * </Provider> * ) * } */ exports.wrapRootElement = true; /***/ }), /***/ "./.cache/caches/gatsby-plugin-material-ui/styles-provider-props.js": /*!**************************************************************************!*\ !*** ./.cache/caches/gatsby-plugin-material-ui/styles-provider-props.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = null; /***/ }), /***/ "./.cache/default-html.js": /*!********************************!*\ !*** ./.cache/default-html.js ***! \********************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HTML; }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); function HTML(props) { return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("html", props.htmlAttributes, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("head", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("meta", { charSet: "utf-8" }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("meta", { httpEquiv: "x-ua-compatible", content: "ie=edge" }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("meta", { name: "viewport", content: "width=device-width, initial-scale=1, shrink-to-fit=no" }), props.headComponents), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("body", props.bodyAttributes, props.preBodyComponents, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { key: "body", id: "___gatsby", dangerouslySetInnerHTML: { __html: props.body } }), props.postBodyComponents)); } HTML.propTypes = { htmlAttributes: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object, headComponents: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array, bodyAttributes: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object, preBodyComponents: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array, body: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, postBodyComponents: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array }; /***/ }), /***/ "./.cache/develop-static-entry.js": /*!****************************************!*\ !*** ./.cache/develop-static-entry.js ***! \****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash_merge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/merge */ "lodash/merge"); /* harmony import */ var lodash_merge__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_merge__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react_dom_server__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom/server */ "react-dom/server"); /* harmony import */ var react_dom_server__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom_server__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _api_runner_ssr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./api-runner-ssr */ "./.cache/api-runner-ssr.js"); /* harmony import */ var _api_runner_ssr__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_api_runner_ssr__WEBPACK_IMPORTED_MODULE_3__); // import testRequireError from "./test-require-error" // For some extremely mysterious reason, webpack adds the above module *after* // this module so that when this code runs, testRequireError is undefined. // So in the meantime, we'll just inline it. var testRequireError = function testRequireError(moduleName, err) { var regex = new RegExp("Error: Cannot find module\\s." + moduleName); var firstLine = err.toString().split("\n")[0]; return regex.test(firstLine); }; var Html; try { Html = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module '../src/html'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())); } catch (err) { if (testRequireError("../src/html", err)) { Html = __webpack_require__(/*! ./default-html */ "./.cache/default-html.js"); } else { console.log("There was an error requiring \"src/html.js\"\n\n", err, "\n\n"); process.exit(); } } Html = Html && Html.__esModule ? Html.default : Html; /* harmony default export */ __webpack_exports__["default"] = (function (pagePath, callback) { var headComponents = [/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("meta", { key: "environment", name: "note", content: "environment=development" })]; var htmlAttributes = {}; var bodyAttributes = {}; var preBodyComponents = []; var postBodyComponents = []; var bodyProps = {}; var htmlStr; var setHeadComponents = function setHeadComponents(components) { headComponents = headComponents.concat(components); }; var setHtmlAttributes = function setHtmlAttributes(attributes) { htmlAttributes = lodash_merge__WEBPACK_IMPORTED_MODULE_0___default()(htmlAttributes, attributes); }; var setBodyAttributes = function setBodyAttributes(attributes) { bodyAttributes = lodash_merge__WEBPACK_IMPORTED_MODULE_0___default()(bodyAttributes, attributes); }; var setPreBodyComponents = function setPreBodyComponents(components) { preBodyComponents = preBodyComponents.concat(components); }; var setPostBodyComponents = function setPostBodyComponents(components) { postBodyComponents = postBodyComponents.concat(components); }; var setBodyProps = function setBodyProps(props) { bodyProps = lodash_merge__WEBPACK_IMPORTED_MODULE_0___default()({}, bodyProps, props); }; var getHeadComponents = function getHeadComponents() { return headComponents; }; var replaceHeadComponents = function replaceHeadComponents(components) { headComponents = components; }; var getPreBodyComponents = function getPreBodyComponents() { return preBodyComponents; }; var replacePreBodyComponents = function replacePreBodyComponents(components) { preBodyComponents = components; }; var getPostBodyComponents = function getPostBodyComponents() { return postBodyComponents; }; var replacePostBodyComponents = function replacePostBodyComponents(components) { postBodyComponents = components; }; _api_runner_ssr__WEBPACK_IMPORTED_MODULE_3___default()("onRenderBody", { setHeadComponents: setHeadComponents, setHtmlAttributes: setHtmlAttributes, setBodyAttributes: setBodyAttributes, setPreBodyComponents: setPreBodyComponents, setPostBodyComponents: setPostBodyComponents, setBodyProps: setBodyProps, pathname: pagePath }); _api_runner_ssr__WEBPACK_IMPORTED_MODULE_3___default()("onPreRenderHTML", { getHeadComponents: getHeadComponents, replaceHeadComponents: replaceHeadComponents, getPreBodyComponents: getPreBodyComponents, replacePreBodyComponents: replacePreBodyComponents, getPostBodyComponents: getPostBodyComponents, replacePostBodyComponents: replacePostBodyComponents, pathname: pagePath }); var htmlElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(Html, Object.assign({}, bodyProps, { body: "", headComponents: headComponents.concat([/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("script", { key: "io", src: "/socket.io/socket.io.js" })]), htmlAttributes: htmlAttributes, bodyAttributes: bodyAttributes, preBodyComponents: preBodyComponents, postBodyComponents: postBodyComponents.concat([/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("script", { key: "polyfill", src: "/polyfill.js", noModule: true }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("script", { key: "commons", src: "/commons.js" })]) })); htmlStr = Object(react_dom_server__WEBPACK_IMPORTED_MODULE_2__["renderToStaticMarkup"])(htmlElement); htmlStr = "<!DOCTYPE html>" + htmlStr; callback(null, htmlStr); }); /***/ }), /***/ "./.cache/emitter.js": /*!***************************!*\ !*** ./.cache/emitter.js ***! \***************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var mitt__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mitt */ "./node_modules/mitt/dist/mitt.es.js"); var emitter = Object(mitt__WEBPACK_IMPORTED_MODULE_0__["default"])(); /* harmony default export */ __webpack_exports__["default"] = (emitter); /***/ }), /***/ "./.cache/find-path.js": /*!*****************************!*\ !*** ./.cache/find-path.js ***! \*****************************/ /*! exports provided: setMatchPaths, findMatchPath, grabMatchParams, findPath, cleanPath */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setMatchPaths", function() { return setMatchPaths; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findMatchPath", function() { return findMatchPath; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "grabMatchParams", function() { return grabMatchParams; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findPath", function() { return findPath; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cleanPath", function() { return cleanPath; }); /* harmony import */ var _reach_router_lib_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @reach/router/lib/utils */ "./node_modules/@reach/router/lib/utils.js"); /* harmony import */ var _reach_router_lib_utils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_reach_router_lib_utils__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _strip_prefix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./strip-prefix */ "./.cache/strip-prefix.js"); /* harmony import */ var _normalize_page_path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./normalize-page-path */ "./.cache/normalize-page-path.js"); var pathCache = new Map(); var matchPaths = []; var trimPathname = function trimPathname(rawPathname) { var pathname = decodeURIComponent(rawPathname); // Remove the pathPrefix from the pathname. var trimmedPathname = Object(_strip_prefix__WEBPACK_IMPORTED_MODULE_1__["default"])(pathname, "") // Remove any hashfragment .split("#")[0] // Remove search query .split("?")[0]; return trimmedPathname; }; function absolutify(path) { // If it's already absolute, return as-is if (path.startsWith("/") || path.startsWith("https://") || path.startsWith("http://")) { return path; } // Calculate path relative to current location, adding a trailing slash to // match behavior of @reach/router return new URL(path, window.location.href + (window.location.href.endsWith("/") ? "" : "/")).pathname; } /** * Set list of matchPaths * * @param {Array<{path: string, matchPath: string}>} value collection of matchPaths */ var setMatchPaths = function setMatchPaths(value) { matchPaths = value; }; /** * Return a matchpath url * if `match-paths.json` contains `{ "/foo*": "/page1", ...}`, then * `/foo?bar=far` => `/page1` * * @param {string} rawPathname A raw pathname * @return {string|null} */ var findMatchPath = function findMatchPath(rawPathname) { var trimmedPathname = cleanPath(rawPathname); var pickPaths = matchPaths.map(function (_ref) { var path = _ref.path, matchPath = _ref.matchPath; return { path: matchPath, originalPath: path }; }); var path = Object(_reach_router_lib_utils__WEBPACK_IMPORTED_MODULE_0__["pick"])(pickPaths, trimmedPathname); if (path) { return Object(_normalize_page_path__WEBPACK_IMPORTED_MODULE_2__["default"])(path.route.originalPath); } return null; }; /** * Return a matchpath params from reach/router rules * if `match-paths.json` contains `{ ":bar/*foo" }`, and the path is /baz/zaz/zoo * then it returns * { bar: baz, foo: zaz/zoo } * * @param {string} rawPathname A raw pathname * @return {object} */ var grabMatchParams = function grabMatchParams(rawPathname) { var trimmedPathname = cleanPath(rawPathname); var pickPaths = matchPaths.map(function (_ref2) { var path = _ref2.path, matchPath = _ref2.matchPath; return { path: matchPath, originalPath: path }; }); var path = Object(_reach_router_lib_utils__WEBPACK_IMPORTED_MODULE_0__["pick"])(pickPaths, trimmedPathname); if (path) { return path.params; } return {}; }; // Given a raw URL path, returns the cleaned version of it (trim off // `#` and query params), or if it matches an entry in // `match-paths.json`, its matched path is returned // // E.g. `/foo?bar=far` => `/foo` // // Or if `match-paths.json` contains `{ "/foo*": "/page1", ...}`, then // `/foo?bar=far` => `/page1` var findPath = function findPath(rawPathname) { var trimmedPathname = trimPathname(absolutify(rawPathname)); if (pathCache.has(trimmedPathname)) { return pathCache.get(trimmedPathname); } var foundPath = findMatchPath(trimmedPathname); if (!foundPath) { foundPath = cleanPath(rawPathname); } pathCache.set(trimmedPathname, foundPath); return foundPath; }; /** * Clean a url and converts /index.html => / * E.g. `/foo?bar=far` => `/foo` * * @param {string} rawPathname A raw pathname * @return {string} */ var cleanPath = function cleanPath(rawPathname) { var trimmedPathname = trimPathname(absolutify(rawPathname)); var foundPath = trimmedPathname; if (foundPath === "/index.html") { foundPath = "/"; } foundPath = Object(_normalize_page_path__WEBPACK_IMPORTED_MODULE_2__["default"])(foundPath); return foundPath; }; /***/ }), /***/ "./.cache/gatsby-browser-entry.js": /*!****************************************!*\ !*** ./.cache/gatsby-browser-entry.js ***! \****************************************/ /*! exports provided: Link, withAssetPrefix, withPrefix, graphql, parsePath, navigate, push, replace, navigateTo, useScrollRestoration, StaticQueryContext, StaticQuery, PageRenderer, useStaticQuery, prefetchPathname */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "graphql", function() { return graphql; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StaticQueryContext", function() { return StaticQueryContext; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StaticQuery", function() { return StaticQuery; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "useStaticQuery", function() { return useStaticQuery; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prefetchPathname", function() { return prefetchPathname; }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var gatsby_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! gatsby-link */ "./node_modules/gatsby-link/index.js"); /* harmony import */ var gatsby_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(gatsby_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony reexport (default from non-harmony) */ __webpack_require__.d(__webpack_exports__, "Link", function() { return gatsby_link__WEBPACK_IMPORTED_MODULE_2___default.a; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withAssetPrefix", function() { return gatsby_link__WEBPACK_IMPORTED_MODULE_2__["withAssetPrefix"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withPrefix", function() { return gatsby_link__WEBPACK_IMPORTED_MODULE_2__["withPrefix"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parsePath", function() { return gatsby_link__WEBPACK_IMPORTED_MODULE_2__["parsePath"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "navigate", function() { return gatsby_link__WEBPACK_IMPORTED_MODULE_2__["navigate"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "push", function() { return gatsby_link__WEBPACK_IMPORTED_MODULE_2__["push"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "replace", function() { return gatsby_link__WEBPACK_IMPORTED_MODULE_2__["replace"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "navigateTo", function() { return gatsby_link__WEBPACK_IMPORTED_MODULE_2__["navigateTo"]; }); /* harmony import */ var gatsby_react_router_scroll__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! gatsby-react-router-scroll */ "./node_modules/gatsby-react-router-scroll/index.js"); /* harmony import */ var gatsby_react_router_scroll__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(gatsby_react_router_scroll__WEBPACK_IMPORTED_MODULE_3__); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useScrollRestoration", function() { return gatsby_react_router_scroll__WEBPACK_IMPORTED_MODULE_3__["useScrollRestoration"]; }); /* harmony import */ var _public_page_renderer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./public-page-renderer */ "./.cache/public-page-renderer.js"); /* harmony import */ var _public_page_renderer__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_public_page_renderer__WEBPACK_IMPORTED_MODULE_4__); /* harmony reexport (default from non-harmony) */ __webpack_require__.d(__webpack_exports__, "PageRenderer", function() { return _public_page_renderer__WEBPACK_IMPORTED_MODULE_4___default.a; }); /* harmony import */ var _loader__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./loader */ "./.cache/loader.js"); var prefetchPathname = _loader__WEBPACK_IMPORTED_MODULE_5__["default"].enqueue; var StaticQueryContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext({}); function StaticQueryDataRenderer(_ref) { var staticQueryData = _ref.staticQueryData, data = _ref.data, query = _ref.query, render = _ref.render; var finalData = data ? data.data : staticQueryData[query] && staticQueryData[query].data; return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, finalData && render(finalData), !finalData && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, "Loading (StaticQuery)")); } var StaticQuery = function StaticQuery(props) { var data = props.data, query = props.query, render = props.render, children = props.children; return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(StaticQueryContext.Consumer, null, function (staticQueryData) { return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(StaticQueryDataRenderer, { data: data, query: query, render: render || children, staticQueryData: staticQueryData }); }); }; var useStaticQuery = function useStaticQuery(query) { var _context$query; if (typeof react__WEBPACK_IMPORTED_MODULE_0___default.a.useContext !== "function" && "development" === "development") { throw new Error("You're likely using a version of React that doesn't support Hooks\n" + "Please update React and ReactDOM to 16.8.0 or later to use the useStaticQuery hook."); } var context = react__WEBPACK_IMPORTED_MODULE_0___default.a.useContext(StaticQueryContext); // query is a stringified number like `3303882` when wrapped with graphql, If a user forgets // to wrap the query in a grqphql, then casting it to a Number results in `NaN` allowing us to // catch the misuse of the API and give proper direction if (isNaN(Number(query))) { throw new Error("useStaticQuery was called with a string but expects to be called using `graphql`. Try this:\n\nimport { useStaticQuery, graphql } from 'gatsby';\n\nuseStaticQuery(graphql`" + query + "`);\n"); } if ((_context$query = context[query]) !== null && _context$query !== void 0 && _context$query.data) { return context[query].data; } else { throw new Error("The result of this StaticQuery could not be fetched.\n\n" + "This is likely a bug in Gatsby and if refreshing the page does not fix it, " + "please open an issue in https://github.com/gatsbyjs/gatsby/issues"); } }; StaticQuery.propTypes = { data: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object, query: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired, render: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func }; function graphql() { throw new Error("It appears like Gatsby is misconfigured. Gatsby related `graphql` calls " + "are supposed to only be evaluated at compile time, and then compiled away. " + "Unfortunately, something went wrong and the query was left in the compiled code.\n\n" + "Unless your site has a complex or custom babel/Gatsby configuration this is likely a bug in Gatsby."); } /***/ }), /***/ "./.cache/loader.js": /*!**************************!*\ !*** ./.cache/loader.js ***! \**************************/ /*! exports provided: PageResourceStatus, BaseLoader, ProdLoader, setLoader, publicLoader, default, getStaticQueryResults */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PageResourceStatus", function() { return PageResourceStatus; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseLoader", function() { return BaseLoader; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ProdLoader", function() { return ProdLoader; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLoader", function() { return setLoader; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publicLoader", function() { return publicLoader; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getStaticQueryResults", function() { return getStaticQueryResults; }); /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/gatsby/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/gatsby/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); /* harmony import */ var _prefetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./prefetch */ "./.cache/prefetch.js"); /* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./emitter */ "./.cache/emitter.js"); /* harmony import */ var _find_path__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./find-path */ "./.cache/find-path.js"); /** * Available resource loading statuses */ var PageResourceStatus = { /** * At least one of critical resources failed to load */ Error: "error", /** * Resources loaded successfully */ Success: "success" }; var preferDefault = function preferDefault(m) { return m && m.default || m; }; var stripSurroundingSlashes = function stripSurroundingSlashes(s) { s = s[0] === "/" ? s.slice(1) : s; s = s.endsWith("/") ? s.slice(0, -1) : s; return s; }; var createPageDataUrl = function createPageDataUrl(path) { var fixedPath = path === "/" ? "index" : stripSurroundingSlashes(path); return "" + "/page-data/" + fixedPath + "/page-data.json"; }; function doFetch(url, method) { if (method === void 0) { method = "GET"; } return new Promise(function (resolve, reject) { var req = new XMLHttpRequest(); req.open(method, url, true); req.onreadystatechange = function () { if (req.readyState == 4) { resolve(req); } }; req.send(null); }); } var doesConnectionSupportPrefetch = function doesConnectionSupportPrefetch() { if ("connection" in navigator && typeof navigator.connection !== "undefined") { if ((navigator.connection.effectiveType || "").includes("2g")) { return false; } if (navigator.connection.saveData) { return false; } } return true; }; var toPageResources = function toPageResources(pageData, component) { if (component === void 0) { component = null; } var page = { componentChunkName: pageData.componentChunkName, path: pageData.path, webpackCompilationHash: pageData.webpackCompilationHash, matchPath: pageData.matchPath, staticQueryHashes: pageData.staticQueryHashes }; return { component: component, json: pageData.result, page: page }; }; var BaseLoader = /*#__PURE__*/function () { function BaseLoader(loadComponent, matchPaths) { this.inFlightNetworkRequests = new Map(); // Map of pagePath -> Page. Where Page is an object with: { // status: PageResourceStatus.Success || PageResourceStatus.Error, // payload: PageResources, // undefined if PageResourceStatus.Error // } // PageResources is { // component, // json: pageData.result, // page: { // componentChunkName, // path, // webpackCompilationHash, // staticQueryHashes // }, // staticQueryResults // } this.pageDb = new Map(); this.inFlightDb = new Map(); this.staticQueryDb = {}; this.pageDataDb = new Map(); this.prefetchTriggered = new Set(); this.prefetchCompleted = new Set(); this.loadComponent = loadComponent; Object(_find_path__WEBPACK_IMPORTED_MODULE_4__["setMatchPaths"])(matchPaths); } var _proto = BaseLoader.prototype; _proto.memoizedGet = function memoizedGet(url) { var _this = this; var inFlightPromise = this.inFlightNetworkRequests.get(url); if (!inFlightPromise) { inFlightPromise = doFetch(url, "GET"); this.inFlightNetworkRequests.set(url, inFlightPromise); } // Prefer duplication with then + catch over .finally to prevent problems in ie11 + firefox return inFlightPromise.then(function (response) { _this.inFlightNetworkRequests.delete(url); return response; }).catch(function (err) { _this.inFlightNetworkRequests.delete(url); throw err; }); }; _proto.setApiRunner = function setApiRunner(apiRunner) { this.apiRunner = apiRunner; this.prefetchDisabled = apiRunner("disableCorePrefetching").some(function (a) { return a; }); }; _proto.fetchPageDataJson = function fetchPageDataJson(loadObj) { var _this2 = this; var pagePath = loadObj.pagePath, _loadObj$retries = loadObj.retries, retries = _loadObj$retries === void 0 ? 0 : _loadObj$retries; var url = createPageDataUrl(pagePath); return this.memoizedGet(url).then(function (req) { var status = req.status, responseText = req.responseText; // Handle 200 if (status === 200) { try { var jsonPayload = JSON.parse(responseText); if (jsonPayload.path === undefined) { throw new Error("not a valid pageData response"); } return Object.assign(loadObj, { status: PageResourceStatus.Success, payload: jsonPayload }); } catch (err) {// continue regardless of error } } // Handle 404 if (status === 404 || status === 200) { // If the request was for a 404 page and it doesn't exist, we're done if (pagePath === "/404.html") { return Object.assign(loadObj, { status: PageResourceStatus.Error }); } // Need some code here to cache the 404 request. In case // multiple loadPageDataJsons result in 404s return _this2.fetchPageDataJson(Object.assign(loadObj, { pagePath: "/404.html", notFound: true })); } // handle 500 response (Unrecoverable) if (status === 500) { return Object.assign(loadObj, { status: PageResourceStatus.Error }); } // Handle everything else, including status === 0, and 503s. Should retry if (retries < 3) { return _this2.fetchPageDataJson(Object.assign(loadObj, { retries: retries + 1 })); } // Retried 3 times already, result is an error. return Object.assign(loadObj, { status: PageResourceStatus.Error }); }); }; _proto.loadPageDataJson = function loadPageDataJson(rawPath) { var _this3 = this; var pagePath = Object(_find_path__WEBPACK_IMPORTED_MODULE_4__["findPath"])(rawPath); if (this.pageDataDb.has(pagePath)) { var pageData = this.pageDataDb.get(pagePath); if (true) { return Promise.resolve(pageData); } } return this.fetchPageDataJson({ pagePath: pagePath }).then(function (pageData) { _this3.pageDataDb.set(pagePath, pageData); return pageData; }); }; _proto.findMatchPath = function findMatchPath(rawPath) { return Object(_find_path__WEBPACK_IMPORTED_MODULE_4__["findMatchPath"])(rawPath); } // TODO check all uses of this and whether they use undefined for page resources not exist ; _proto.loadPage = function loadPage(rawPath) { var _this4 = this; var pagePath = Object(_find_path__WEBPACK_IMPORTED_MODULE_4__["findPath"])(rawPath); if (this.pageDb.has(pagePath)) { var page = this.pageDb.get(pagePath); if (true) { return Promise.resolve(page.payload); } } if (this.inFlightDb.has(pagePath)) { return this.inFlightDb.get(pagePath); } var inFlightPromise = Promise.all([this.loadAppData(), this.loadPageDataJson(pagePath)]).then(function (allData) { var result = allData[1]; if (result.status === PageResourceStatus.Error) { return { status: PageResourceStatus.Error }; } var pageData = result.payload; var _pageData = pageData, componentChunkName = _pageData.componentChunkName, _pageData$staticQuery = _pageData.staticQueryHashes, staticQueryHashes = _pageData$staticQuery === void 0 ? [] : _pageData$staticQuery; var finalResult = {}; var componentChunkPromise = _this4.loadComponent(componentChunkName).then(function (component) { finalResult.createdAt = new Date(); var pageResources; if (!component) { finalResult.status = PageResourceStatus.Error;