{"ast":null,"code":"// This module is shared between NodeJS and babelled ES5\nvar _require = require('@patternfly/documentation-framework/helpers/slugger'),\n    makeSlug = _require.makeSlug,\n    slugger = _require.slugger;\n\nvar _require2 = require('@patternfly/documentation-framework/helpers/asyncComponentFactory'),\n    asyncComponentFactory = _require2.asyncComponentFactory;\n\nvar clientRoutes = require('./routes-client'); // Webpack replaces this import: patternfly-docs.routes.js\n\n\nvar generatedRoutes = require('./routes-generated'); // Webpack replaces this import: patternfly-docs/generated/index.js\n\n\nvar routes = Object.assign({}, clientRoutes, generatedRoutes);\n\nfor (var route in routes) {\n  var pageData = routes[route];\n\n  if (pageData.SyncComponent) {\n    pageData.Component = pageData.SyncComponent;\n  } else if (pageData.Component) {\n    pageData.Component = asyncComponentFactory(route, pageData);\n  }\n} // Save a copy of all routes for path matching on first load\n\n\nvar allRoutes = Object.assign({}, routes); // Group routes by section, id\n\nvar isNull = function isNull(o) {\n  return o === null || o === undefined;\n};\n\nvar groupedRoutes = Object.entries(routes).filter(function (_ref) {\n  var _slug = _ref[0],\n      _ref$ = _ref[1],\n      id = _ref$.id,\n      section = _ref$.section;\n  return !isNull(id) && !isNull(section);\n}).reduce(function (accum, _ref2) {\n  var slug = _ref2[0],\n      pageData = _ref2[1];\n  var section = pageData.section,\n      id = pageData.id,\n      title = pageData.title,\n      source = pageData.source,\n      katacodaLayout = pageData.katacodaLayout,\n      hideNavItem = pageData.hideNavItem;\n  accum[section] = accum[section] || {};\n  accum[section][id] = accum[section][id] || {\n    id: id,\n    section: section,\n    title: title,\n    slug: makeSlug(source, section, id, true),\n    sources: [],\n    katacodaLayout: katacodaLayout,\n    hideNavItem: hideNavItem\n  };\n  pageData.slug = slug;\n  accum[section][id].sources.push(pageData);\n  return accum;\n}, {});\nvar sourceOrder = {\n  react: 1,\n  'react-composable': 1.1,\n  'react-legacy': 1.2,\n  'react-demos': 2,\n  html: 3,\n  'html-demos': 4,\n  'design-guidelines': 99,\n  'accessibility': 100\n};\nvar defaultOrder = 50;\n\nvar sortSources = function sortSources(_ref3, _ref4) {\n  var s1 = _ref3.source;\n  var s2 = _ref4.source;\n  var s1Index = sourceOrder[s1] || defaultOrder;\n  var s2Index = sourceOrder[s2] || defaultOrder;\n\n  if (s1Index === defaultOrder && s2Index === defaultOrder) {\n    return s1.localeCompare(s2);\n  }\n\n  return s1Index > s2Index ? 1 : -1;\n};\n\nvar getDefaultDesignGuidelines = function getDefaultDesignGuidelines(_ref5) {\n  var id = _ref5.id,\n      section = _ref5.section,\n      slug = _ref5.slug,\n      title = _ref5.title;\n\n  var Component = function Component() {\n    return require('@patternfly/documentation-framework/templates/design-guidelines').DesignGuidelineTemplate;\n  };\n\n  var pageData = {\n    id: id,\n    section: section,\n    slug: slug + \"/design-guidelines\",\n    source: 'design-guidelines',\n    title: title,\n    Component: Component\n  };\n\n  Component.getPageData = function () {\n    return pageData;\n  };\n\n  return pageData;\n};\n\nObject.entries(groupedRoutes).forEach(function (_ref6) {\n  var _section = _ref6[0],\n      ids = _ref6[1];\n  Object.values(ids).forEach(function (pageData) {\n    var slug = pageData.slug,\n        section = pageData.section; // Remove source routes for `app.js`\n\n    pageData.sources.forEach(function (_ref7) {\n      var slug = _ref7.slug;\n      delete routes[slug];\n    }); // Add design guidelines if doesn't exist\n\n    if (['components', 'charts', 'layouts', 'demos'].includes(section) && !pageData.sources.map(function (_ref8) {\n      var source = _ref8.source;\n      return source;\n    }).includes('design-guidelines') && process.env.hasDesignGuidelines) {\n      pageData.sources.push(getDefaultDesignGuidelines(pageData));\n    } // Sort sources for tabs\n\n\n    pageData.sources = pageData.sources.sort(sortSources); // Add grouped route\n\n    routes[slug] = pageData;\n  });\n});\n\nfunction getAsyncComponent(url) {\n  if (!url && typeof window !== 'undefined') {\n    url = window.location.pathname.replace(/\\/$/, '') || '/';\n  } // Normalize path for matching\n\n\n  url = url.replace(process.env.pathPrefix, '');\n  var res;\n\n  if (allRoutes[url]) {\n    res = allRoutes[url].Component;\n  } else if (routes[url]) {\n    res = routes[url].sources[0].Component;\n  }\n\n  if (res && res.preload) {\n    return res;\n  }\n\n  return null;\n}\n\nvar fullscreenRoutes = Object.entries(allRoutes).filter(function (_ref9) {\n  var _ref9$ = _ref9[1],\n      examples = _ref9$.examples,\n      fullscreenExamples = _ref9$.fullscreenExamples;\n  return examples || fullscreenExamples;\n}).reduce(function (acc, val) {\n  var path = val[0],\n      _val$ = val[1],\n      Component = _val$.Component,\n      _val$$examples = _val$.examples,\n      examples = _val$$examples === void 0 ? [] : _val$$examples,\n      _val$$fullscreenExamp = _val$.fullscreenExamples,\n      fullscreenExamples = _val$$fullscreenExamp === void 0 ? [] : _val$$fullscreenExamp;\n  examples.concat(fullscreenExamples).forEach(function (title) {\n    var slug = path + \"/\" + slugger(title);\n    acc[slug] = {\n      title: title,\n      Component: Component,\n      isFullscreen: true,\n      isFullscreenOnly: fullscreenExamples.includes(title)\n    };\n  });\n  return acc;\n}, {});\nmodule.exports = {\n  routes: routes,\n  groupedRoutes: groupedRoutes,\n  fullscreenRoutes: fullscreenRoutes,\n  getAsyncComponent: getAsyncComponent\n};","map":{"version":3,"names":["require","makeSlug","slugger","asyncComponentFactory","clientRoutes","generatedRoutes","routes","route","pageData","SyncComponent","Component","allRoutes","Object","assign","isNull","o","undefined","groupedRoutes","entries","filter","_slug","id","section","reduce","accum","slug","title","source","katacodaLayout","hideNavItem","sources","push","sourceOrder","react","html","defaultOrder","sortSources","s1","s2","s1Index","s2Index","localeCompare","getDefaultDesignGuidelines","DesignGuidelineTemplate","getPageData","forEach","_section","ids","values","includes","map","process","env","hasDesignGuidelines","sort","getAsyncComponent","url","window","location","pathname","replace","pathPrefix","res","preload","fullscreenRoutes","examples","fullscreenExamples","acc","val","path","concat","isFullscreen","isFullscreenOnly","module","exports"],"sources":["/Users/ausulliv/repos/temp/patternfly-react/node_modules/@patternfly/documentation-framework/routes.js"],"sourcesContent":["// This module is shared between NodeJS and babelled ES5\nconst { makeSlug, slugger } = require('@patternfly/documentation-framework/helpers/slugger');\nconst { asyncComponentFactory } = require('@patternfly/documentation-framework/helpers/asyncComponentFactory');\nconst clientRoutes = require('./routes-client'); // Webpack replaces this import: patternfly-docs.routes.js\nconst generatedRoutes = require('./routes-generated'); // Webpack replaces this import: patternfly-docs/generated/index.js\n\nconst routes = {\n  ...clientRoutes,\n  ...generatedRoutes\n};\n\nfor (let route in routes) {\n  const pageData = routes[route];\n  if (pageData.SyncComponent) {\n    pageData.Component = pageData.SyncComponent;\n  }\n  else if (pageData.Component) {\n    pageData.Component = asyncComponentFactory(route, pageData);\n  }\n}\n\n// Save a copy of all routes for path matching on first load\nconst allRoutes = Object.assign({}, routes);\n\n// Group routes by section, id\nconst isNull = o => o === null || o === undefined;\n\nconst groupedRoutes = Object.entries(routes)\n  .filter(([_slug, { id, section }]) => !isNull(id) && !isNull(section))\n  .reduce((accum, [slug, pageData]) => {\n    const { section, id, title, source, katacodaLayout, hideNavItem } = pageData;\n    accum[section] = accum[section] || {};\n    accum[section][id] = accum[section][id] || {\n      id,\n      section,\n      title,\n      slug: makeSlug(source, section, id, true),\n      sources: [],\n      katacodaLayout,\n      hideNavItem\n    };\n\n    pageData.slug = slug;\n    accum[section][id].sources.push(pageData);\n\n    return accum;\n  }, {});\n\nconst sourceOrder = {\n  react: 1,\n  'react-composable': 1.1,\n  'react-legacy': 1.2,\n  'react-demos': 2,\n  html: 3,\n  'html-demos': 4,\n  'design-guidelines': 99,\n  'accessibility': 100\n};\nconst defaultOrder = 50;\n\nconst sortSources = ({ source: s1 }, { source: s2 }) => {\n  const s1Index = sourceOrder[s1] || defaultOrder;\n  const s2Index = sourceOrder[s2] || defaultOrder;\n  if (s1Index === defaultOrder && s2Index === defaultOrder) {\n    return s1.localeCompare(s2);\n  }\n\n  return s1Index > s2Index ? 1 : -1;\n}\n\nconst getDefaultDesignGuidelines = ({ id, section, slug, title }) => {\n  const Component = () => require('@patternfly/documentation-framework/templates/design-guidelines').DesignGuidelineTemplate\n  const pageData = {\n    id,\n    section,\n    slug: `${slug}/design-guidelines`,\n    source: 'design-guidelines',\n    title,\n    Component\n  };\n\n  Component.getPageData = () => pageData;\n\n  return pageData;\n}\n\nObject.entries(groupedRoutes)\n  .forEach(([_section, ids]) => {\n    Object.values(ids).forEach(pageData => {\n      const { slug, section } = pageData;\n      // Remove source routes for `app.js`\n      pageData.sources.forEach(({ slug }) => {\n        delete routes[slug];\n      });\n      // Add design guidelines if doesn't exist\n      if (\n        ['components', 'charts', 'layouts', 'demos'].includes(section) &&\n        !pageData.sources.map(({ source }) => source).includes('design-guidelines') &&\n        process.env.hasDesignGuidelines\n      ) {\n        pageData.sources.push(getDefaultDesignGuidelines(pageData));\n      }\n      // Sort sources for tabs\n      pageData.sources = pageData.sources.sort(sortSources);\n      // Add grouped route\n      routes[slug] = pageData;\n    })\n  });\n\nfunction getAsyncComponent(url) {\n  if (!url && typeof window !== 'undefined') {\n    url = window.location.pathname.replace(/\\/$/, '') || '/';\n  }\n  // Normalize path for matching\n  url = url.replace(process.env.pathPrefix, '');\n  let res;\n\n  if (allRoutes[url]) {\n    res = allRoutes[url].Component;\n  }\n  else if (routes[url]) {\n    res = routes[url].sources[0].Component;\n  }\n\n  if (res && res.preload) {\n    return res;\n  }\n\n  return null;\n}\n\nconst fullscreenRoutes = Object.entries(allRoutes)\n  .filter(([, { examples, fullscreenExamples }]) => examples || fullscreenExamples)\n  .reduce((acc, val) => {\n    const [path, { Component, examples = [], fullscreenExamples = [] }] = val;\n    examples\n      .concat(fullscreenExamples)\n      .forEach(title => {\n        const slug = `${path}/${slugger(title)}`;\n        acc[slug] = {\n          title,\n          Component,\n          isFullscreen: true,\n          isFullscreenOnly: fullscreenExamples.includes(title)\n        };\n      });\n    return acc;\n  }, {});\n\nmodule.exports = {\n  routes,\n  groupedRoutes,\n  fullscreenRoutes,\n  getAsyncComponent\n};\n"],"mappings":"AAAA;eAC8BA,OAAO,CAAC,qDAAD,C;IAA7BC,Q,YAAAA,Q;IAAUC,O,YAAAA,O;;gBACgBF,O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