{"ast":null,"code":"import { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nvar _jsxFileName = \"/home/alexis/code/sigmajs-org/pages/examples/[example].tsx\";\nimport React from \"react\";\nimport Head from \"next/head\";\nimport ErrorPage from \"next/error\";\nimport { useRouter } from \"next/router\";\nimport PageLayout from \"../../components/page-layout\";\nimport { findExample, getExampleParams, getExamples } from \"../../lib/examples-api\";\n\nconst ExampleComponent = ({\n  example\n}) => {\n  const router = useRouter();\n  if (!router.isFallback && !(example !== null && example !== void 0 && example.name)) return /*#__PURE__*/_jsxDEV(ErrorPage, {\n    statusCode: 404\n  }, void 0, false, {\n    fileName: _jsxFileName,\n    lineNumber: 13,\n    columnNumber: 52\n  }, this);\n  return /*#__PURE__*/_jsxDEV(PageLayout, {\n    children: [/*#__PURE__*/_jsxDEV(Head, {\n      children: /*#__PURE__*/_jsxDEV(\"title\", {\n        children: [\"Example \", example.name]\n      }, void 0, true, {\n        fileName: _jsxFileName,\n        lineNumber: 18,\n        columnNumber: 9\n      }, this)\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 17,\n      columnNumber: 7\n    }, this), /*#__PURE__*/_jsxDEV(\"h1\", {\n      children: [\"Example \", example.name]\n    }, void 0, true, {\n      fileName: _jsxFileName,\n      lineNumber: 21,\n      columnNumber: 7\n    }, this), /*#__PURE__*/_jsxDEV(\"code\", {\n      dangerouslySetInnerHTML: {\n        __html: example.codeHTML\n      }\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 22,\n      columnNumber: 7\n    }, this)]\n  }, void 0, true, {\n    fileName: _jsxFileName,\n    lineNumber: 16,\n    columnNumber: 5\n  }, this);\n};\n\nexport default ExampleComponent;\nexport async function getStaticProps({\n  params\n}) {\n  const example = findExample(params.example);\n  return {\n    props: {\n      example\n    }\n  };\n}\nexport async function getStaticPaths() {\n  const examples = getExamples();\n  return {\n    paths: examples.map(example => ({\n      params: getExampleParams(example)\n    })),\n    fallback: false\n  };\n}\nexport const config = {\n  unstable_runtimeJS: false\n};","map":{"version":3,"sources":["/home/alexis/code/sigmajs-org/pages/examples/[example].tsx"],"names":["React","Head","ErrorPage","useRouter","PageLayout","findExample","getExampleParams","getExamples","ExampleComponent","example","router","isFallback","name","__html","codeHTML","getStaticProps","params","props","getStaticPaths","examples","paths","map","fallback","config","unstable_runtimeJS"],"mappings":";;AAAA,OAAOA,KAAP,MAA0B,OAA1B;AACA,OAAOC,IAAP,MAAiB,WAAjB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAASC,SAAT,QAA0B,aAA1B;AAGA,OAAOC,UAAP,MAAuB,8BAAvB;AACA,SAASC,WAAT,EAAsBC,gBAAtB,EAAwCC,WAAxC,QAA2D,wBAA3D;;AAEA,MAAMC,gBAA0C,GAAG,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAiB;AAClE,QAAMC,MAAM,GAAGP,SAAS,EAAxB;AAEA,MAAI,CAACO,MAAM,CAACC,UAAR,IAAsB,EAACF,OAAD,aAACA,OAAD,eAACA,OAAO,CAAEG,IAAV,CAA1B,EAA0C,oBAAO,QAAC,SAAD;AAAW,IAAA,UAAU,EAAE;AAAvB;AAAA;AAAA;AAAA;AAAA,UAAP;AAE1C,sBACE,QAAC,UAAD;AAAA,4BACE,QAAC,IAAD;AAAA,6BACE;AAAA,+BAAgBH,OAAO,CAACG,IAAxB;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YADF,eAKE;AAAA,6BAAaH,OAAO,CAACG,IAArB;AAAA;AAAA;AAAA;AAAA;AAAA,YALF,eAME;AAAM,MAAA,uBAAuB,EAAE;AAAEC,QAAAA,MAAM,EAAEJ,OAAO,CAACK;AAAlB;AAA/B;AAAA;AAAA;AAAA;AAAA,YANF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAUD,CAfD;;AAiBA,eAAeN,gBAAf;AAQA,OAAO,eAAeO,cAAf,CAA8B;AAAEC,EAAAA;AAAF,CAA9B,EAAkD;AACvD,QAAMP,OAAO,GAAGJ,WAAW,CAACW,MAAM,CAACP,OAAR,CAA3B;AAEA,SAAO;AACLQ,IAAAA,KAAK,EAAE;AACLR,MAAAA;AADK;AADF,GAAP;AAKD;AAED,OAAO,eAAeS,cAAf,GAAgC;AACrC,QAAMC,QAAQ,GAAGZ,WAAW,EAA5B;AAEA,SAAO;AACLa,IAAAA,KAAK,EAAED,QAAQ,CAACE,GAAT,CAAcZ,OAAD,KAAc;AAAEO,MAAAA,MAAM,EAAEV,gBAAgB,CAACG,OAAD;AAA1B,KAAd,CAAb,CADF;AAELa,IAAAA,QAAQ,EAAE;AAFL,GAAP;AAID;AAED,OAAO,MAAMC,MAAM,GAAG;AACpBC,EAAAA,kBAAkB,EAAE;AADA,CAAf","sourcesContent":["import React, { FC } from \"react\";\nimport Head from \"next/head\";\nimport ErrorPage from \"next/error\";\nimport { useRouter } from \"next/router\";\n\nimport { Example } from \"../../lib/types\";\nimport PageLayout from \"../../components/page-layout\";\nimport { findExample, getExampleParams, getExamples } from \"../../lib/examples-api\";\n\nconst ExampleComponent: FC<{ example: Example }> = ({ example }) => {\n  const router = useRouter();\n\n  if (!router.isFallback && !example?.name) return <ErrorPage statusCode={404} />;\n\n  return (\n    <PageLayout>\n      <Head>\n        <title>Example {example.name}</title>\n      </Head>\n\n      <h1>Example {example.name}</h1>\n      <code dangerouslySetInnerHTML={{ __html: example.codeHTML }} />\n    </PageLayout>\n  );\n};\n\nexport default ExampleComponent;\n\ntype Params = {\n  params: {\n    example: string;\n  };\n};\n\nexport async function getStaticProps({ params }: Params) {\n  const example = findExample(params.example);\n\n  return {\n    props: {\n      example,\n    },\n  };\n}\n\nexport async function getStaticPaths() {\n  const examples = getExamples();\n\n  return {\n    paths: examples.map((example) => ({ params: getExampleParams(example) })),\n    fallback: false,\n  };\n}\n\nexport const config = {\n  unstable_runtimeJS: false,\n};\n"]},"metadata":{},"sourceType":"module"}