mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-30 10:48:05 +02:00
7 lines
No EOL
41 KiB
JavaScript
7 lines
No EOL
41 KiB
JavaScript
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["32221"],{31091:function(e,n,t){t.r(n),t.d(n,{metadata:()=>s,contentTitle:()=>b,default:()=>k,assets:()=>y,toc:()=>v,frontMatter:()=>g});var s=JSON.parse('{"id":"installation","title":"Installation","description":"How to install Docusaurus locally, and start a Docusaurus site in no time.","source":"@site/docs/installation.mdx","sourceDirName":".","slug":"/installation","permalink":"/docs/installation","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/installation.mdx","tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1729847735000,"frontMatter":{"description":"How to install Docusaurus locally, and start a Docusaurus site in no time."},"sidebar":"docs","previous":{"title":"Getting Started","permalink":"/docs/category/getting-started"},"next":{"title":"Configuration","permalink":"/docs/configuration"}}'),r=t("24246"),o=t("80980"),a=t("15398"),i=t("58636");t("27378");var c=t("90158"),l=t("35363"),d=t("71607"),u=t("77827"),h=t("49356"),p=t("95998");let m=void 0;function j(){let e=(0,c.yW)(m),n=(0,c.gB)(m),t="current"===e.name&&n.length>1?n[1].name:e.name;return(0,r.jsx)(p.Z,{language:"json",title:"package.json",children:`{
|
|
"dependencies": {
|
|
"@docusaurus/core": "${t}",
|
|
"@docusaurus/preset-classic": "${t}",
|
|
// ...
|
|
}
|
|
}`})}function x(){let e=(0,c.yW)(m),n=(0,c.Iw)(m).activeVersion;if((0,d.Z)()){let e=window.location.hostname;if(e.includes("netlify.app")&&!e.includes("deploy-preview"))return(0,r.jsx)(h.Z,{type:"caution",children:(0,r.jsx)("p",{children:(0,r.jsx)(u.Z,{id:"upgradeGuide.archivedVersion.notice",values:{mainSiteLink:(0,r.jsx)(l.Z,{href:"https://docusaurus.io/docs/installation",children:(0,r.jsx)(u.Z,{id:"upgradeGuide.archivedVersion.notice.mainSiteLink.label",children:"main site"})})},children:"You are browsing an archived version and the snippet below is outdated. Please go to the {mainSiteLink} and follow the instructions there to upgrade to the latest version."})})})}return"current"===n.name?(0,r.jsx)(h.Z,{type:"info",children:(0,r.jsx)("p",{children:(0,r.jsx)(u.Z,{id:"upgradeGuide.unreleasedVersion.notice",values:{canaryDocLink:(0,r.jsx)(l.Z,{href:"/community/canary",children:(0,r.jsx)(u.Z,{id:"upgradeGuide.unreleasedVersion.notice.canaryDocLink.label",values:{canaryTag:(0,r.jsx)("code",{children:"@canary"})},children:"{canaryTag} release"})})},children:"You are browsing the documentation of an unreleased version. If you want to use any unreleased feature, you can use the {canaryDocLink}."})})}):n.name!==e.name?(0,r.jsx)(h.Z,{type:"caution",children:(0,r.jsx)("p",{children:(0,r.jsx)(u.Z,{id:"upgradeGuide.outdatedVersion.notice",children:"You are browsing the documentation of an outdated version. The snippet below shows how to upgrade to the latest version."})})}):null}function f(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x,{}),(0,r.jsx)(j,{})]})}let g={description:"How to install Docusaurus locally, and start a Docusaurus site in no time."},b="Installation",y={},v=[{value:"Requirements",id:"requirements",level:2},{value:"Scaffold project website",id:"scaffold-project-website",level:2},{value:"Project structure",id:"project-structure",level:2},{value:"Project structure rundown",id:"project-structure-rundown",level:3},{value:"Monorepos",id:"monorepos",level:3},{value:"Running the development server",id:"running-the-development-server",level:2},{value:"Build",id:"build",level:2},{value:"Updating your Docusaurus version",id:"updating-your-docusaurus-version",level:2},{value:"Problems?",id:"problems",level:2}];function w(e){let n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.a)(),...e.components},{Details:t}=n;return!t&&function(e,n){throw Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"installation",children:"Installation"})}),"\n","\n",(0,r.jsxs)(n.p,{children:["Docusaurus consists of a set of npm ",(0,r.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/tree/main/packages",children:"packages"}),"."]}),"\n",(0,r.jsxs)(n.admonition,{type:"tip",children:[(0,r.jsxs)(n.p,{children:["Use the ",(0,r.jsx)(n.strong,{children:(0,r.jsx)(n.a,{href:"/docs/#fast-track",children:"Fast Track"})})," to understand Docusaurus in ",(0,r.jsx)(n.strong,{children:"5 minutes \u23F1"}),"!"]}),(0,r.jsxs)(n.p,{children:["Use ",(0,r.jsx)(n.strong,{children:(0,r.jsx)(n.a,{href:"https://docusaurus.new",children:"docusaurus.new"})})," to test Docusaurus immediately in your browser!"]})]}),"\n",(0,r.jsx)(n.h2,{id:"requirements",children:"Requirements"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"https://nodejs.org/en/download/",children:"Node.js"})," version 18.0 or above (which can be checked by running ",(0,r.jsx)(n.code,{children:"node -v"}),"). You can use ",(0,r.jsx)(n.a,{href:"https://github.com/nvm-sh/nvm",children:"nvm"})," for managing multiple Node versions on a single machine installed.","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"When installing Node.js, you are recommended to check all checkboxes related to dependencies."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"scaffold-project-website",children:"Scaffold project website"}),"\n",(0,r.jsx)(n.p,{children:"The easiest way to install Docusaurus is to use the command line tool that helps you scaffold a skeleton Docusaurus website. You can run this command anywhere in a new empty repository or within an existing repository, it will create a new directory containing the scaffolded files."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npx create-docusaurus@latest my-website classic\n"})}),"\n",(0,r.jsxs)(n.p,{children:["We recommend the ",(0,r.jsx)(n.code,{children:"classic"})," template so that you can get started quickly, and it contains features found in Docusaurus 1. The ",(0,r.jsx)(n.code,{children:"classic"})," template contains ",(0,r.jsx)(n.code,{children:"@docusaurus/preset-classic"})," which includes standard documentation, a blog, custom pages, and a CSS framework (with dark mode support). You can get up and running extremely quickly with the classic template and customize things later on when you have gained more familiarity with Docusaurus."]}),"\n",(0,r.jsxs)(n.p,{children:["You can also use the template's TypeScript variant by passing the ",(0,r.jsx)(n.code,{children:"--typescript"})," flag. See ",(0,r.jsx)(n.a,{href:"/docs/typescript-support",children:"TypeScript support"})," for more information."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npx create-docusaurus@latest my-website classic --typescript\n"})}),"\n",(0,r.jsxs)(n.admonition,{title:"Meta-Only",type:"info",children:[(0,r.jsx)(n.p,{children:"If you are setting up a new Docusaurus website for a Meta open source project, run this command inside an internal repository, which comes with some useful Meta-specific defaults:"}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"scarf static-docs-bootstrap\n"})})]}),"\n",(0,r.jsxs)(t,{children:[(0,r.jsx)("summary",{children:"Alternative installation commands"}),(0,r.jsx)(n.p,{children:"You can also initialize a new project using your preferred project manager:"}),(0,r.jsxs)(a.Z,{groupId:"npm2yarn",children:[(0,r.jsx)(i.Z,{value:"npm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm init docusaurus\n"})})}),(0,r.jsx)(i.Z,{value:"yarn",label:"Yarn",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"yarn create docusaurus\n"})})}),(0,r.jsx)(i.Z,{value:"pnpm",label:"pnpm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"pnpm create docusaurus\n"})})})]})]}),"\n",(0,r.jsxs)(n.p,{children:["Run ",(0,r.jsx)(n.code,{children:"npx create-docusaurus@latest --help"}),", or check out its ",(0,r.jsx)(n.a,{href:"/docs/api/misc/create-docusaurus",children:"API docs"})," for more information about all available flags."]}),"\n",(0,r.jsx)(n.h2,{id:"project-structure",children:"Project structure"}),"\n",(0,r.jsxs)(n.p,{children:["Assuming you chose the classic template and named your site ",(0,r.jsx)(n.code,{children:"my-website"}),", you will see the following files generated under a new directory ",(0,r.jsx)(n.code,{children:"my-website/"}),":"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"my-website\n\u251C\u2500\u2500 blog\n\u2502 \u251C\u2500\u2500 2019-05-28-hola.md\n\u2502 \u251C\u2500\u2500 2019-05-29-hello-world.md\n\u2502 \u2514\u2500\u2500 2020-05-30-welcome.md\n\u251C\u2500\u2500 docs\n\u2502 \u251C\u2500\u2500 doc1.md\n\u2502 \u251C\u2500\u2500 doc2.md\n\u2502 \u251C\u2500\u2500 doc3.md\n\u2502 \u2514\u2500\u2500 mdx.md\n\u251C\u2500\u2500 src\n\u2502 \u251C\u2500\u2500 css\n\u2502 \u2502 \u2514\u2500\u2500 custom.css\n\u2502 \u2514\u2500\u2500 pages\n\u2502 \u251C\u2500\u2500 styles.module.css\n\u2502 \u2514\u2500\u2500 index.js\n\u251C\u2500\u2500 static\n\u2502 \u2514\u2500\u2500 img\n\u251C\u2500\u2500 docusaurus.config.js\n\u251C\u2500\u2500 package.json\n\u251C\u2500\u2500 README.md\n\u251C\u2500\u2500 sidebars.js\n\u2514\u2500\u2500 yarn.lock\n"})}),"\n",(0,r.jsx)(n.h3,{id:"project-structure-rundown",children:"Project structure rundown"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"/blog/"})," - Contains the blog Markdown files. You can delete the directory if you've disabled the blog plugin, or you can change its name after setting the ",(0,r.jsx)(n.code,{children:"path"})," option. More details can be found in the ",(0,r.jsx)(n.a,{href:"/docs/blog",children:"blog guide"})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"/docs/"})," - Contains the Markdown files for the docs. Customize the order of the docs sidebar in ",(0,r.jsx)(n.code,{children:"sidebars.js"}),". You can delete the directory if you've disabled the docs plugin, or you can change its name after setting the ",(0,r.jsx)(n.code,{children:"path"})," option. More details can be found in the ",(0,r.jsx)(n.a,{href:"/docs/docs-introduction",children:"docs guide"})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"/src/"})," - Non-documentation files like pages or custom React components. You don't have to strictly put your non-documentation files here, but putting them under a centralized directory makes it easier to specify in case you need to do some sort of linting/processing","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"/src/pages"})," - Any JSX/TSX/MDX file within this directory will be converted into a website page. More details can be found in the ",(0,r.jsx)(n.a,{href:"/docs/creating-pages",children:"pages guide"})]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"/static/"})," - Static directory. Any contents inside here will be copied into the root of the final ",(0,r.jsx)(n.code,{children:"build"})," directory"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"/docusaurus.config.js"})," - A config file containing the site configuration. This is the equivalent of ",(0,r.jsx)(n.code,{children:"siteConfig.js"})," in Docusaurus v1"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"/package.json"})," - A Docusaurus website is a React app. You can install and use any npm packages you like in them"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"/sidebars.js"})," - Used by the documentation to specify the order of documents in the sidebar"]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"monorepos",children:"Monorepos"}),"\n",(0,r.jsx)(n.p,{children:"If you are using Docusaurus for documentation of an existing project, a monorepo may be the solution for you. Monorepos allow you to share dependencies between similar projects. For example, your website may use your local packages to showcase latest features instead of depending on a released version. Then, your contributors can update the docs as they implement features. An example monorepo folder structure is below:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"my-monorepo\n\u251C\u2500\u2500 package-a # Another package, your actual project\n\u2502 \u251C\u2500\u2500 src\n\u2502 \u2514\u2500\u2500 package.json # Package A's dependencies\n\u251C\u2500\u2500 website # Docusaurus root\n\u2502 \u251C\u2500\u2500 docs\n\u2502 \u251C\u2500\u2500 src\n\u2502 \u2514\u2500\u2500 package.json # Docusaurus' dependencies\n\u251C\u2500\u2500 package.json # Monorepo's shared dependencies\n"})}),"\n",(0,r.jsxs)(n.p,{children:["In this case, you should run ",(0,r.jsx)(n.code,{children:"npx create-docusaurus"})," within the ",(0,r.jsx)(n.code,{children:"./my-monorepo"})," folder."]}),"\n",(0,r.jsxs)(n.p,{children:["If you're using a hosting provider such as Netlify or Vercel, you will need to change the ",(0,r.jsx)(n.code,{children:"Base directory"})," of the site to where your Docusaurus root is. In this case, that would be ",(0,r.jsx)(n.code,{children:"./website"}),". Read more about configuring ignore commands in the ",(0,r.jsx)(n.a,{href:"/docs/deployment#deploying-to-netlify",children:"deployment docs"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["Read more about monorepos in the ",(0,r.jsx)(n.a,{href:"https://yarnpkg.com/features/workspaces",children:"Yarn documentation"})," (Yarn is not the only way to set up a monorepo, but it's a common solution), or checkout ",(0,r.jsx)(n.a,{href:"https://github.com/facebook/docusaurus",children:"Docusaurus"})," and ",(0,r.jsx)(n.a,{href:"https://github.com/facebook/jest",children:"Jest"})," for some real-world examples."]}),"\n",(0,r.jsx)(n.h2,{id:"running-the-development-server",children:"Running the development server"}),"\n",(0,r.jsx)(n.p,{children:"To preview your changes as you edit the files, you can run a local development server that will serve your website and reflect the latest changes."}),"\n",(0,r.jsxs)(a.Z,{groupId:"npm2yarn",children:[(0,r.jsx)(i.Z,{value:"npm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"cd my-website\nnpm run start\n"})})}),(0,r.jsx)(i.Z,{value:"yarn",label:"Yarn",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"cd my-website\nyarn run start\n"})})}),(0,r.jsx)(i.Z,{value:"pnpm",label:"pnpm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"cd my-website\npnpm run start\n"})})})]}),"\n",(0,r.jsxs)(n.p,{children:["By default, a browser window will open at ",(0,r.jsx)(n.a,{href:"http://localhost:3000",children:(0,r.jsx)(n.code,{children:"http://localhost:3000"})}),"."]}),"\n",(0,r.jsx)(n.p,{children:"Congratulations! You have just created your first Docusaurus site! Browse around the site to see what's available."}),"\n",(0,r.jsx)(n.h2,{id:"build",children:"Build"}),"\n",(0,r.jsx)(n.p,{children:"Docusaurus is a modern static website generator so we need to build the website into a directory of static contents and put it on a web server so that it can be viewed. To build the website:"}),"\n",(0,r.jsxs)(a.Z,{groupId:"npm2yarn",children:[(0,r.jsx)(i.Z,{value:"npm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm run build\n"})})}),(0,r.jsx)(i.Z,{value:"yarn",label:"Yarn",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"yarn build\n"})})}),(0,r.jsx)(i.Z,{value:"pnpm",label:"pnpm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"pnpm run build\n"})})})]}),"\n",(0,r.jsxs)(n.p,{children:["and contents will be generated within the ",(0,r.jsx)(n.code,{children:"/build"})," directory, which can be copied to any static file hosting service like ",(0,r.jsx)(n.a,{href:"https://pages.github.com/",children:"GitHub pages"}),", ",(0,r.jsx)(n.a,{href:"https://vercel.com/",children:"Vercel"})," or ",(0,r.jsx)(n.a,{href:"https://www.netlify.com/",children:"Netlify"}),". Check out the docs on ",(0,r.jsx)(n.a,{href:"/docs/deployment",children:"deployment"})," for more details."]}),"\n",(0,r.jsx)(n.h2,{id:"updating-your-docusaurus-version",children:"Updating your Docusaurus version"}),"\n",(0,r.jsxs)(n.p,{children:["There are many ways to update your Docusaurus version. One guaranteed way is to manually change the version number in ",(0,r.jsx)(n.code,{children:"package.json"})," to the desired version. Note that all ",(0,r.jsx)(n.code,{children:"@docusaurus/"}),"-namespaced packages should be using the same version."]}),"\n","\n",(0,r.jsx)(f,{}),"\n",(0,r.jsxs)(n.p,{children:["Then, in the directory containing ",(0,r.jsx)(n.code,{children:"package.json"}),", run your package manager's install command:"]}),"\n",(0,r.jsxs)(a.Z,{groupId:"npm2yarn",children:[(0,r.jsx)(i.Z,{value:"npm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm install\n"})})}),(0,r.jsx)(i.Z,{value:"yarn",label:"Yarn",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"yarn install\n"})})}),(0,r.jsx)(i.Z,{value:"pnpm",label:"pnpm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"pnpm install\n"})})})]}),"\n",(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"npm install"})," may report several vulnerabilities and recommend running ",(0,r.jsx)(n.code,{children:"npm audit"})," to address them. Typically, these reported vulnerabilities, such as RegExp DOS vulnerabilities, are harmless and can be safely ignored. Also read this article, which reflects our thinking: ",(0,r.jsx)(n.a,{href:"https://overreacted.io/npm-audit-broken-by-design/",children:"npm audit: Broken by Design"}),"."]})}),"\n",(0,r.jsx)(n.p,{children:"To check that the update occurred successfully, run:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npx docusaurus --version\n"})}),"\n",(0,r.jsx)(n.p,{children:"You should see the correct version as output."}),"\n",(0,r.jsx)(n.p,{children:"Alternatively, if you are using Yarn, you can do:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"yarn add @docusaurus/core @docusaurus/preset-classic\n"})}),"\n",(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsxs)(n.p,{children:["Use new unreleased features of Docusaurus with the ",(0,r.jsxs)(n.a,{href:"/community/canary",children:[(0,r.jsx)(n.code,{children:"@canary"})," npm dist tag"]})]})}),"\n",(0,r.jsx)(n.h2,{id:"problems",children:"Problems?"}),"\n",(0,r.jsxs)(n.p,{children:["Ask for help on ",(0,r.jsx)(n.a,{href:"https://stackoverflow.com/questions/tagged/docusaurus",children:"Stack Overflow"}),", on our ",(0,r.jsx)(n.a,{href:"https://github.com/facebook/docusaurus",children:"GitHub repository"}),", our ",(0,r.jsx)(n.a,{href:"https://discordapp.com/invite/docusaurus",children:"Discord server"}),", or ",(0,r.jsx)(n.a,{href:"https://x.com/docusaurus",children:"X"}),"."]})]})}function k(e={}){let{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(w,{...e})}):w(e)}},37796:function(e,n,t){t.d(n,{Z:function(){return r}});var s=t(24246);function r(e){return(0,s.jsx)("svg",{viewBox:"0 0 14 16",...e,children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})})}t(27378)},49356:function(e,n,t){t.d(n,{Z:()=>C});var s=t("24246"),r=t("27378"),o=t("90496"),a=t("77827"),i=t("55951");let c={admonition:"admonition_o5H7",admonitionHeading:"admonitionHeading_FzoX",admonitionIcon:"admonitionIcon_rXq6",admonitionContent:"admonitionContent_Knsx"};function l(e){let{type:n,className:t,children:r}=e;return(0,s.jsx)("div",{className:(0,o.Z)(i.k.common.admonition,i.k.common.admonitionType(n),c.admonition,t),children:r})}function d(e){let{icon:n,title:t}=e;return(0,s.jsxs)("div",{className:c.admonitionHeading,children:[(0,s.jsx)("span",{className:c.admonitionIcon,children:n}),t]})}function u(e){let{children:n}=e;return n?(0,s.jsx)("div",{className:c.admonitionContent,children:n}):null}function h(e){let{type:n,icon:t,title:r,children:o,className:a}=e;return(0,s.jsxs)(l,{type:n,className:a,children:[r||t?(0,s.jsx)(d,{title:r,icon:t}):null,(0,s.jsx)(u,{children:o})]})}let p={icon:(0,s.jsx)(function(e){return(0,s.jsx)("svg",{viewBox:"0 0 14 16",...e,children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})})},{}),title:(0,s.jsx)(a.Z,{id:"theme.admonition.note",description:"The default label used for the Note admonition (:::note)",children:"note"})};function m(e){return(0,s.jsx)(h,{...p,...e,className:(0,o.Z)("alert alert--secondary",e.className),children:e.children})}let j={icon:(0,s.jsx)(function(e){return(0,s.jsx)("svg",{viewBox:"0 0 12 16",...e,children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})})},{}),title:(0,s.jsx)(a.Z,{id:"theme.admonition.tip",description:"The default label used for the Tip admonition (:::tip)",children:"tip"})};function x(e){return(0,s.jsx)(h,{...j,...e,className:(0,o.Z)("alert alert--success",e.className),children:e.children})}var f=t("37796");let g={icon:(0,s.jsx)(f.Z,{}),title:(0,s.jsx)(a.Z,{id:"theme.admonition.info",description:"The default label used for the Info admonition (:::info)",children:"info"})};function b(e){return(0,s.jsx)(h,{...g,...e,className:(0,o.Z)("alert alert--info",e.className),children:e.children})}function y(e){return(0,s.jsx)("svg",{viewBox:"0 0 16 16",...e,children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})})}let v={icon:(0,s.jsx)(y,{}),title:(0,s.jsx)(a.Z,{id:"theme.admonition.warning",description:"The default label used for the Warning admonition (:::warning)",children:"warning"})},w={icon:(0,s.jsx)(function(e){return(0,s.jsx)("svg",{viewBox:"0 0 12 16",...e,children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})})},{}),title:(0,s.jsx)(a.Z,{id:"theme.admonition.danger",description:"The default label used for the Danger admonition (:::danger)",children:"danger"})},k={icon:(0,s.jsx)(y,{}),title:(0,s.jsx)(a.Z,{id:"theme.admonition.caution",description:"The default label used for the Caution admonition (:::caution)",children:"caution"})},N={note:m,tip:x,info:b,warning:function(e){return(0,s.jsx)(h,{...v,...e,className:(0,o.Z)("alert alert--warning",e.className),children:e.children})},danger:function(e){return(0,s.jsx)(h,{...w,...e,className:(0,o.Z)("alert alert--danger",e.className),children:e.children})},secondary:e=>(0,s.jsx)(m,{title:"secondary",...e}),important:e=>(0,s.jsx)(b,{title:"important",...e}),success:e=>(0,s.jsx)(x,{title:"success",...e}),caution:function(e){return(0,s.jsx)(h,{...k,...e,className:(0,o.Z)("alert alert--warning",e.className),children:e.children})}};var Z=t("57922");let B={...N,"my-custom-admonition":function(e){return(0,s.jsxs)("div",{style:{border:"solid red",padding:10},children:[(0,s.jsx)(Z.Z,{as:"h5",style:{color:"blue",fontSize:30},children:e.title}),(0,s.jsx)("div",{children:e.children})]})}};function C(e){let n=function(e){let{mdxAdmonitionTitle:n,rest:t}=function(e){let n=r.Children.toArray(e),t=n.find(e=>r.isValidElement(e)&&"mdxAdmonitionTitle"===e.type),o=n.filter(e=>e!==t);return{mdxAdmonitionTitle:t?.props.children,rest:o.length>0?(0,s.jsx)(s.Fragment,{children:o}):null}}(e.children),o=e.title??n;return{...e,...o&&{title:o},children:t}}(e),t=function(e){let n=B[e];return n?n:(console.warn(`No admonition component found for admonition type "${e}". Using Info as fallback.`),B.info)}(n.type);return(0,s.jsx)(t,{...n})}},58636:function(e,n,t){t.d(n,{Z:()=>a});var s=t("24246");t("27378");var r=t("90496");let o="tabItem_pnkT";function a(e){let{children:n,hidden:t,className:a}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,r.Z)(o,a),hidden:t,children:n})}},15398:function(e,n,t){t.d(n,{Z:()=>y});var s=t("24246"),r=t("27378"),o=t("90496"),a=t("54947"),i=t("3620"),c=t("844"),l=t("97486"),d=t("32263"),u=t("16971");function h(e){return r.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||r.isValidElement(e)&&function(e){let{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw Error(`Docusaurus error: Bad <Tabs> child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){let{value:n,tabValues:t}=e;return t.some(e=>e.value===n)}var m=t("71607");let j="tabList_Qoir",x="tabItem_AQgk";function f(e){let{className:n,block:t,selectedValue:r,selectValue:i,tabValues:c}=e,l=[],{blockElementScrollPositionUntilNextRender:d}=(0,a.o5)(),u=e=>{let n=e.currentTarget,t=c[l.indexOf(n)].value;t!==r&&(d(n),i(t))},h=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{let t=l.indexOf(e.currentTarget)+1;n=l[t]??l[0];break}case"ArrowLeft":{let t=l.indexOf(e.currentTarget)-1;n=l[t]??l[l.length-1]}}n?.focus()};return(0,s.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":t},n),children:c.map(e=>{let{value:n,label:t,attributes:a}=e;return(0,s.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>l.push(e),onKeyDown:h,onClick:u,...a,className:(0,o.Z)("tabs__item",x,a?.className,{"tabs__item--active":r===n}),children:t??n},n)})})}function g(e){let{lazy:n,children:t,selectedValue:a}=e,i=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){let e=i.find(e=>e.props.value===a);return e?(0,r.cloneElement)(e,{className:(0,o.Z)("margin-top--md",e.props.className)}):null}return(0,s.jsx)("div",{className:"margin-top--md",children:i.map((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==a}))})}function b(e){let n=function(e){let{defaultValue:n,queryString:t=!1,groupId:s}=e,o=function(e){let{values:n,children:t}=e;return(0,r.useMemo)(()=>{let e=n??h(t).map(e=>{let{props:{value:n,label:t,attributes:s,default:r}}=e;return{value:n,label:t,attributes:s,default:r}});return!function(e){let n=(0,d.lx)(e,(e,n)=>e.value===n.value);if(n.length>0)throw Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e},[n,t])}(e),[a,m]=(0,r.useState)(()=>(function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(n){if(!p({value:n,tabValues:t}))throw Error(`Docusaurus error: The <Tabs> has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}let s=t.find(e=>e.default)??t[0];if(!s)throw Error("Unexpected error: 0 tabValues");return s.value})({defaultValue:n,tabValues:o})),[j,x]=function(e){let{queryString:n=!1,groupId:t}=e,s=(0,i.k6)(),o=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t}),a=(0,l._X)(o);return[a,(0,r.useCallback)(e=>{if(!o)return;let n=new URLSearchParams(s.location.search);n.set(o,e),s.replace({...s.location,search:n.toString()})},[o,s])]}({queryString:t,groupId:s}),[f,g]=function(e){var n;let{groupId:t}=e;let s=(n=t)?`docusaurus.tab.${n}`:null,[o,a]=(0,u.Nk)(s);return[o,(0,r.useCallback)(e=>{if(!!s)a.set(e)},[s,a])]}({groupId:s}),b=(()=>{let e=j??f;return p({value:e,tabValues:o})?e:null})();return(0,c.Z)(()=>{b&&m(b)},[b]),{selectedValue:a,selectValue:(0,r.useCallback)(e=>{if(!p({value:e,tabValues:o}))throw Error(`Can't select invalid tab value=${e}`);m(e),x(e),g(e)},[x,g,o]),tabValues:o}}(e);return(0,s.jsxs)("div",{className:(0,o.Z)("tabs-container",j),children:[(0,s.jsx)(f,{...n,...e}),(0,s.jsx)(g,{...n,...e})]})}function y(e){let n=(0,m.Z)();return(0,s.jsx)(b,{...e,children:h(e.children)},String(n))}},56497:function(e,n,t){t.d(n,{Z:function(){return o}});var s=t(24246);t(27378);var r=t(71607);function o(e){let{children:n,fallback:t}=e;return(0,r.Z)()?(0,s.jsx)(s.Fragment,{children:n?.()}):t??null}},95998:function(e,n,t){t.d(n,{Z:()=>ea});var s,r={};t.r(r),t.d(r,{ButtonExample:()=>D});var o=t("24246"),a=t("27378"),i=t("90496"),c=t("71607"),l=t("10075"),d=t("77827"),u=t("8156"),h=t("56497"),p=t("85108"),m=t("45245"),j=t("26378");function x(){let{prism:e}=(0,j.L)(),{colorMode:n}=(0,m.I)(),t=e.theme,s=e.darkTheme||t;return"dark"===n?s:t}var f=t("67490");let g="playgroundContainer_6Ior",b="playgroundHeader_Tvsk",y="playgroundEditor_TySg",v="playgroundPreview_mApW";function w(e){let{children:n}=e;return(0,o.jsx)("div",{className:(0,i.Z)(b),children:n})}function k(){return(0,o.jsx)("div",{children:"Loading..."})}function N(){return(0,o.jsx)(h.Z,{fallback:(0,o.jsx)(k,{}),children:()=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(f.Z,{fallback:e=>(0,o.jsx)(p.Ac,{...e}),children:(0,o.jsx)(l.i5,{})}),(0,o.jsx)(l.IF,{})]})})}function Z(){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(w,{children:(0,o.jsx)(d.Z,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,o.jsx)("div",{className:v,children:(0,o.jsx)(N,{})})]})}function B(){let e=(0,c.Z)();return(0,o.jsx)(l.uz,{className:y},String(e))}function C(){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(w,{children:(0,o.jsx)(d.Z,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,o.jsx)(B,{})]})}let T=e=>`${e};`;function I(e){let{children:n,transformCode:t,...s}=e,{siteConfig:{themeConfig:r}}=(0,u.Z)(),{liveCodeBlock:{playgroundPosition:a}}=r,i=x(),c=s.metastring?.includes("noInline")??!1;return(0,o.jsx)("div",{className:g,children:(0,o.jsx)(l.nu,{code:n?.replace(/\n$/,""),noInline:c,transformCode:t??T,theme:i,...s,children:"top"===a?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Z,{}),(0,o.jsx)(C,{})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(C,{}),(0,o.jsx)(Z,{})]})})})}function D(e){return(0,o.jsx)("button",{type:"button",...e,style:{backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer",...e.style}})}let L={React:a,...a,...r};var E=t("55951"),S=t("6324"),A=t.n(S);let M=/title=(?<quote>["'])(?<title>.*?)\1/,_=/\{(?<range>[\d,-]+)\}/,z={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},H={...z,lua:{start:"--",end:""},wasm:{start:"\\;\\;",end:""},tex:{start:"%",end:""},vb:{start:"['\u2018\u2019]",end:""},vbnet:{start:"(?:_\\s*)?['\u2018\u2019]",end:""},rem:{start:"[Rr][Ee][Mm]\\b",end:""},f90:{start:"!",end:""},ml:{start:"\\(\\*",end:"\\*\\)"},cobol:{start:"\\*>",end:""}},R=Object.keys(z);function V(e,n){let t=e.map(e=>{let{start:t,end:s}=H[e];return`(?:${t}\\s*(${n.flatMap(e=>[e.line,e.block?.start,e.block?.end].filter(Boolean)).join("|")})\\s*${s})`}).join("|");return RegExp(`^\\s*(?:${t})\\s*$`)}let $="codeBlockContainer_jDV4";function Y(e){let{as:n,...t}=e,s=function(e){let n={color:"--prism-color",backgroundColor:"--prism-background-color"},t={};return Object.entries(e.plain).forEach(e=>{let[s,r]=e,o=n[s];o&&"string"==typeof r&&(t[o]=r)}),t}(x());return(0,o.jsx)(n,{...t,style:s,className:(0,i.Z)(t.className,$,E.k.common.codeBlock)})}let q={codeBlockContent:"codeBlockContent_vx7S",codeBlockTitle:"codeBlockTitle_bdru",codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q",buttonGroup:"buttonGroup_cUGO"};function O(e){let{children:n,className:t}=e;return(0,o.jsx)(Y,{as:"pre",tabIndex:0,className:(0,i.Z)(q.codeBlockStandalone,"thin-scrollbar",t),children:(0,o.jsx)("code",{className:q.codeBlockLines,children:n})})}var W=t("50923");let F={attributes:!0,characterData:!0,childList:!0,subtree:!0};var P=t("7316");let G={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function U(e){let{line:n,classNames:t,showLineNumbers:s,getLineProps:r,getTokenProps:a}=e;1===n.length&&"\n"===n[0].content&&(n[0].content="");let c=r({line:n,className:(0,i.Z)(t,s&&G.codeLine)}),l=n.map((e,n)=>(0,o.jsx)("span",{...a({token:e})},n));return(0,o.jsxs)("span",{...c,children:[s?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:G.codeLineNumber}),(0,o.jsx)("span",{className:G.codeLineContent,children:l})]}):l,(0,o.jsx)("br",{})]})}var X=t("44771");function Q(e){return(0,o.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,o.jsx)("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})})}function J(e){return(0,o.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,o.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}let K={copyButtonCopied:"copyButtonCopied_OkN_",copyButtonIcons:"copyButtonIcons_OqsO",copyButtonIcon:"copyButtonIcon_PgCn",copyButtonSuccessIcon:"copyButtonSuccessIcon_bsQG"};function ee(e){let{code:n,className:t}=e,[s,r]=(0,a.useState)(!1),c=(0,a.useRef)(void 0),l=(0,a.useCallback)(()=>{(0,X.Z)(n),r(!0),c.current=window.setTimeout(()=>{r(!1)},1e3)},[n]);return(0,a.useEffect)(()=>()=>window.clearTimeout(c.current),[]),(0,o.jsx)("button",{type:"button","aria-label":s?(0,d.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,d.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,d.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,i.Z)("clean-btn",t,K.copyButton,s&&K.copyButtonCopied),onClick:l,children:(0,o.jsxs)("span",{className:K.copyButtonIcons,"aria-hidden":"true",children:[(0,o.jsx)(Q,{className:K.copyButtonIcon}),(0,o.jsx)(J,{className:K.copyButtonSuccessIcon})]})})}function en(e){return(0,o.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,o.jsx)("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})})}let et={wordWrapButtonIcon:"wordWrapButtonIcon_MQXS",wordWrapButtonEnabled:"wordWrapButtonEnabled_TBIH"};function es(e){let{className:n,onClick:t,isEnabled:s}=e,r=(0,d.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,o.jsx)("button",{type:"button",onClick:t,className:(0,i.Z)("clean-btn",n,s&&et.wordWrapButtonEnabled),"aria-label":r,title:r,children:(0,o.jsx)(en,{className:et.wordWrapButtonIcon,"aria-hidden":"true"})})}function er(e){var n,t,s;let{children:r,className:c="",metastring:l,title:d,showLineNumbers:u,language:h}=e,{prism:{defaultLanguage:p,magicComments:m}}=(0,j.L)();let f=(n=h??function(e){let n=e.split(" ").find(e=>e.startsWith("language-"));return n?.replace(/language-/,"")}(c)??p,n?.toLowerCase()),g=x(),b=function(){let[e,n]=(0,a.useState)(!1),[t,s]=(0,a.useState)(!1),r=(0,a.useRef)(null),o=(0,a.useCallback)(()=>{let t=r.current.querySelector("code");e?t.removeAttribute("style"):(t.style.whiteSpace="pre-wrap",t.style.overflowWrap="anywhere"),n(e=>!e)},[r,e]),i=(0,a.useCallback)(()=>{let{scrollWidth:e,clientWidth:n}=r.current;s(e>n||r.current.querySelector("code").hasAttribute("style"))},[r]);return!function(e,n){let[t,s]=(0,a.useState)(),r=(0,a.useCallback)(()=>{s(e.current?.closest("[role=tabpanel][hidden]"))},[e,s]);(0,a.useEffect)(()=>{r()},[r]),!function(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:F,s=(0,W.zX)(n),r=(0,W.Ql)(t);(0,a.useEffect)(()=>{let n=new MutationObserver(s);return e&&n.observe(e,r),()=>n.disconnect()},[e,s,r])}(t,e=>{e.forEach(e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(n(),r())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1})}(r,i),(0,a.useEffect)(()=>{i()},[e,i]),(0,a.useEffect)(()=>(window.addEventListener("resize",i,{passive:!0}),()=>{window.removeEventListener("resize",i)}),[i]),{codeBlockRef:r,isEnabled:e,isCodeScrollable:t,toggle:o}}();let y=(t=l,(t?.match(M)?.groups.title??"")||d),{lineClassNames:v,code:w}=function(e,n){let t=e.replace(/\n$/,""),{language:s,magicComments:r,metastring:o}=n;if(o&&_.test(o)){let e=o.match(_).groups.range;if(0===r.length)throw Error(`A highlight range has been given in code block's metastring (\`\`\` ${o}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);let n=r[0].className;return{lineClassNames:Object.fromEntries(A()(e).filter(e=>e>0).map(e=>[e-1,[n]])),code:t}}if(void 0===s)return{lineClassNames:{},code:t};let a=function(e,n){switch(e){case"js":case"javascript":case"ts":case"typescript":return V(["js","jsBlock"],n);case"jsx":case"tsx":return V(["js","jsBlock","jsx"],n);case"html":return V(["js","jsBlock","html"],n);case"python":case"py":case"bash":return V(["bash"],n);case"markdown":case"md":return V(["html","jsx","bash"],n);case"tex":case"latex":case"matlab":return V(["tex"],n);case"lua":case"haskell":case"sql":return V(["lua"],n);case"wasm":return V(["wasm"],n);case"vb":case"vba":case"visual-basic":return V(["vb","rem"],n);case"vbnet":return V(["vbnet","rem"],n);case"batch":return V(["rem"],n);case"basic":return V(["rem","f90"],n);case"fsharp":return V(["js","ml"],n);case"ocaml":case"sml":return V(["ml"],n);case"fortran":return V(["f90"],n);case"cobol":return V(["cobol"],n);default:return V(R,n)}}(s,r),i=t.split("\n"),c=Object.fromEntries(r.map(e=>[e.className,{start:0,range:""}])),l=Object.fromEntries(r.filter(e=>e.line).map(e=>{let{className:n,line:t}=e;return[t,n]})),d=Object.fromEntries(r.filter(e=>e.block).map(e=>{let{className:n,block:t}=e;return[t.start,n]})),u=Object.fromEntries(r.filter(e=>e.block).map(e=>{let{className:n,block:t}=e;return[t.end,n]}));for(let e=0;e<i.length;){let n=i[e].match(a);if(!n){e+=1;continue}let t=n.slice(1).find(e=>void 0!==e);l[t]?c[l[t]].range+=`${e},`:d[t]?c[d[t]].start=e:u[t]&&(c[u[t]].range+=`${c[u[t]].start}-${e-1},`),i.splice(e,1)}t=i.join("\n");let h={};return Object.entries(c).forEach(e=>{let[n,{range:t}]=e;A()(t).forEach(e=>{h[e]??=[],h[e].push(n)})}),{lineClassNames:h,code:t}}(r,{metastring:l,language:f,magicComments:m});let k=u??(s=l,!!s?.includes("showLineNumbers"));return(0,o.jsxs)(Y,{as:"div",className:(0,i.Z)(c,f&&!c.includes(`language-${f}`)&&`language-${f}`),children:[y&&(0,o.jsx)("div",{className:q.codeBlockTitle,children:y}),(0,o.jsxs)("div",{className:q.codeBlockContent,children:[(0,o.jsx)(P.y$,{theme:g,code:w,language:f??"text",children:e=>{let{className:n,style:t,tokens:s,getLineProps:r,getTokenProps:a}=e;return(0,o.jsx)("pre",{tabIndex:0,ref:b.codeBlockRef,className:(0,i.Z)(n,q.codeBlock,"thin-scrollbar"),style:t,children:(0,o.jsx)("code",{className:(0,i.Z)(q.codeBlockLines,k&&q.codeBlockLinesWithNumbering),children:s.map((e,n)=>(0,o.jsx)(U,{line:e,getLineProps:r,getTokenProps:a,classNames:v[n],showLineNumbers:k},n))})})}}),(0,o.jsxs)("div",{className:q.buttonGroup,children:[(b.isEnabled||b.isCodeScrollable)&&(0,o.jsx)(es,{className:q.codeButton,onClick:()=>b.toggle(),isEnabled:b.isEnabled}),(0,o.jsx)(ee,{className:q.codeButton,code:w})]})]})]})}let eo=(s=function(e){var n;let{children:t,...s}=e,r=(0,c.Z)();let i=(n=t,a.Children.toArray(n).some(e=>(0,a.isValidElement)(e))?n:Array.isArray(n)?n.join(""):n),l="string"==typeof i?er:O;return(0,o.jsx)(l,{...s,children:i},String(r))},function(e){return e.live?(0,o.jsx)(I,{scope:L,...e}):(0,o.jsx)(s,{...e})});function ea(e){return(0,o.jsx)(eo,{...e})}}}]); |