"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["79397"],{41553:function(e,n,t){t.r(n),t.d(n,{metadata:()=>s,contentTitle:()=>u,default:()=>j,assets:()=>h,toc:()=>p,frontMatter:()=>d});var s=JSON.parse('{"id":"api/plugins/plugin-content-pages","title":"\uD83D\uDCE6 plugin-content-pages","description":"The default pages plugin for Docusaurus. The classic template ships with this plugin with default configurations. This plugin provides creating pages functionality.","source":"@site/docs/api/plugins/plugin-content-pages.mdx","sourceDirName":"api/plugins","slug":"/api/plugins/@docusaurus/plugin-content-pages","permalink":"/docs/api/plugins/@docusaurus/plugin-content-pages","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/plugins/plugin-content-pages.mdx","tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1729847735000,"sidebarPosition":3,"frontMatter":{"sidebar_position":3,"slug":"/api/plugins/@docusaurus/plugin-content-pages"},"sidebar":"api","previous":{"title":"\uD83D\uDCE6 plugin-content-blog","permalink":"/docs/api/plugins/@docusaurus/plugin-content-blog"},"next":{"title":"\uD83D\uDCE6 plugin-client-redirects","permalink":"/docs/api/plugins/@docusaurus/plugin-client-redirects"}}'),r=t("24246"),l=t("80980"),i=t("15398"),c=t("58636"),o=t("32240"),a=t("66359");let d={sidebar_position:3,slug:"/api/plugins/@docusaurus/plugin-content-pages"},u="\uD83D\uDCE6 plugin-content-pages",h={},p=[{value:"Installation",id:"installation",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Types",id:"types",level:3},{value:"EditUrlFn
",id:"EditUrlFn",level:4},{value:"Example configuration",id:"ex-config",level:3},{value:"Markdown front matter",id:"markdown-front-matter",level:2},{value:"i18n",id:"i18n",level:2},{value:"Translation files location",id:"translation-files-location",level:3},{value:"Example file-system structure",id:"example-file-system-structure",level:3}];function x(e){let n={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,l.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"-plugin-content-pages",children:"\uD83D\uDCE6 plugin-content-pages"})}),"\n","\n",(0,r.jsxs)(n.p,{children:["The default pages plugin for Docusaurus. The classic template ships with this plugin with default configurations. This plugin provides ",(0,r.jsx)(n.a,{href:"/docs/creating-pages",children:"creating pages"})," functionality."]}),"\n",(0,r.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,r.jsxs)(i.Z,{groupId:"npm2yarn",children:[(0,r.jsx)(c.Z,{value:"npm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm install --save @docusaurus/plugin-content-pages\n"})})}),(0,r.jsx)(c.Z,{value:"yarn",label:"Yarn",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"yarn add @docusaurus/plugin-content-pages\n"})})}),(0,r.jsx)(c.Z,{value:"pnpm",label:"pnpm",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"pnpm add @docusaurus/plugin-content-pages\n"})})})]}),"\n",(0,r.jsxs)(n.admonition,{type:"tip",children:[(0,r.jsxs)(n.p,{children:["If you use the preset ",(0,r.jsx)(n.code,{children:"@docusaurus/preset-classic"}),", you don't need to install this plugin as a dependency."]}),(0,r.jsxs)(n.p,{children:["You can configure this plugin through the ",(0,r.jsx)(n.a,{href:"/docs/using-plugins#docusauruspreset-classic",children:"preset options"}),"."]})]}),"\n",(0,r.jsx)(n.h2,{id:"configuration",children:"Configuration"}),"\n",(0,r.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Default"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"path"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'src/pages'"})}),(0,r.jsx)(n.td,{children:"Path to data on filesystem relative to site dir. Components in this directory will be automatically converted to pages."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"editUrl"})}),(0,r.jsx)(n.td,{children:(0,r.jsxs)("code",{children:["string | ",(0,r.jsx)(n.a,{href:"#EditUrlFn",children:"EditUrlFn"})]})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Only for Markdown pages"}),". Base URL to edit your site. The final URL is computed by ",(0,r.jsx)(n.code,{children:"editUrl + relativePostPath"}),". Using a function allows more nuanced control for each file. Omitting this variable entirely will disable edit links."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"editLocalizedFiles"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Only for Markdown pages"}),". The edit URL will target the localized file, instead of the original unlocalized file. Ignored when ",(0,r.jsx)(n.code,{children:"editUrl"})," is a function."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"routeBasePath"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'/'"})}),(0,r.jsxs)(n.td,{children:["URL route for the pages section of your site. ",(0,r.jsx)(n.strong,{children:"DO NOT"})," include a trailing slash."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"include"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"['**/*.{js,jsx,ts,tsx,md,mdx}']"})}),(0,r.jsx)(n.td,{children:"Matching files will be included and processed."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"exclude"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.em,{children:"See example configuration"})}),(0,r.jsx)(n.td,{children:"No route will be created for matching files."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"mdxPageComponent"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"'@theme/MDXPage'"})}),(0,r.jsx)(n.td,{children:"Component used by each MDX page."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"remarkPlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:"Remark plugins passed to MDX."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"rehypePlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:"Rehype plugins passed to MDX."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"rehypePlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:"Recma plugins passed to MDX."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"beforeDefaultRemarkPlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:"Custom Remark plugins passed to MDX before the default Docusaurus Remark plugins."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"beforeDefaultRehypePlugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"any[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"[]"})}),(0,r.jsx)(n.td,{children:"Custom Rehype plugins passed to MDX before the default Docusaurus Rehype plugins."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"showLastUpdateAuthor"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Only for Markdown pages"}),". Whether to display the author who last updated the page."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"showLastUpdateTime"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.strong,{children:"Only for Markdown pages"}),". Whether to display the last date the page post was updated. This requires access to git history during the build, so will not work correctly with shallow clones (a common default for CI systems). With GitHub ",(0,r.jsx)(n.code,{children:"actions/checkout"}),", use",(0,r.jsx)(n.code,{children:"fetch-depth: 0"}),"."]})]})]})]})}),"\n",(0,r.jsx)(n.h3,{id:"types",children:"Types"}),"\n",(0,r.jsx)(n.h4,{id:"EditUrlFn",children:(0,r.jsx)(n.code,{children:"EditUrlFn"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:"type EditUrlFunction = (params: {\n blogDirPath: string;\n blogPath: string;\n permalink: string;\n locale: string;\n}) => string | undefined;\n"})}),"\n",(0,r.jsx)(n.h3,{id:"ex-config",children:"Example configuration"}),"\n",(0,r.jsx)(n.p,{children:"You can configure this plugin through preset options or plugin options."}),"\n",(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsx)(n.p,{children:"Most Docusaurus users configure this plugin through the preset options."})}),"\n","\n",(0,r.jsx)(a.Z,{pluginName:"@docusaurus/plugin-content-pages",presetOptionName:"pages",code:"{\n path: 'src/pages',\n routeBasePath: '',\n include: ['**/*.{js,jsx,ts,tsx,md,mdx}'],\n exclude: [\n '**/_*.{js,jsx,ts,tsx,md,mdx}',\n '**/_*/**',\n '**/*.test.{js,jsx,ts,tsx}',\n '**/__tests__/**',\n ],\n mdxPageComponent: '@theme/MDXPage',\n remarkPlugins: [require('./my-remark-plugin')],\n rehypePlugins: [],\n beforeDefaultRemarkPlugins: [],\n beforeDefaultRehypePlugins: [],\n}"}),"\n",(0,r.jsx)(n.h2,{id:"markdown-front-matter",children:"Markdown front matter"}),"\n",(0,r.jsxs)(n.p,{children:["Markdown pages can use the following Markdown ",(0,r.jsx)(n.a,{href:"/docs/markdown-features#front-matter",children:"front matter"})," metadata fields, enclosed by a line ",(0,r.jsx)(n.code,{children:"---"})," on either side."]}),"\n",(0,r.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,r.jsx)(o.Z,{children:(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Default"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"title"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:"Markdown title"}),(0,r.jsx)(n.td,{children:"The blog post title."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"description"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:"The first line of Markdown content"}),(0,r.jsxs)(n.td,{children:["The description of your page, which will become the ",(0,r.jsx)(n.code,{children:''})," and ",(0,r.jsx)(n.code,{children:''})," in ",(0,r.jsx)(n.code,{children:"
["'])(?.*?)\1/,P=/\{(? [\d,-]+)\}/,A={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},R={...A,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:""}},$=Object.keys(A);function O(e,n){let t=e.map(e=>{let{start:t,end:s}=R[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 U="codeBlockContainer_jDV4";function F(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,l=n[s];l&&"string"==typeof r&&(t[l]=r)}),t}(g());return(0,l.jsx)(n,{...t,style:s,className:(0,c.Z)(t.className,U,_.k.common.codeBlock)})}let W={codeBlockContent:"codeBlockContent_vx7S",codeBlockTitle:"codeBlockTitle_bdru",codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q",buttonGroup:"buttonGroup_cUGO"};function V(e){let{children:n,className:t}=e;return(0,l.jsx)(F,{as:"pre",tabIndex:0,className:(0,c.Z)(W.codeBlockStandalone,"thin-scrollbar",t),children:(0,l.jsx)("code",{className:W.codeBlockLines,children:n})})}var q=t("50923");let H={attributes:!0,characterData:!0,childList:!0,subtree:!0};var X=t("7316");let z={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function G(e){let{line:n,classNames:t,showLineNumbers:s,getLineProps:r,getTokenProps:i}=e;1===n.length&&"\n"===n[0].content&&(n[0].content="");let o=r({line:n,className:(0,c.Z)(t,s&&z.codeLine)}),a=n.map((e,n)=>(0,l.jsx)("span",{...i({token:e})},n));return(0,l.jsxs)("span",{...o,children:[s?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:z.codeLineNumber}),(0,l.jsx)("span",{className:z.codeLineContent,children:a})]}):a,(0,l.jsx)("br",{})]})}var J=t("44771");function Q(e){return(0,l.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,l.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 Y(e){return(0,l.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,l.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,i.useState)(!1),o=(0,i.useRef)(void 0),a=(0,i.useCallback)(()=>{(0,J.Z)(n),r(!0),o.current=window.setTimeout(()=>{r(!1)},1e3)},[n]);return(0,i.useEffect)(()=>()=>window.clearTimeout(o.current),[]),(0,l.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,c.Z)("clean-btn",t,K.copyButton,s&&K.copyButtonCopied),onClick:a,children:(0,l.jsxs)("span",{className:K.copyButtonIcons,"aria-hidden":"true",children:[(0,l.jsx)(Q,{className:K.copyButtonIcon}),(0,l.jsx)(Y,{className:K.copyButtonSuccessIcon})]})})}function en(e){return(0,l.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,l.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,l.jsx)("button",{type:"button",onClick:t,className:(0,c.Z)("clean-btn",n,s&&et.wordWrapButtonEnabled),"aria-label":r,title:r,children:(0,l.jsx)(en,{className:et.wordWrapButtonIcon,"aria-hidden":"true"})})}function er(e){var n,t,s;let{children:r,className:o="",metastring:a,title:d,showLineNumbers:u,language:h}=e,{prism:{defaultLanguage:p,magicComments:x}}=(0,j.L)();let m=(n=h??function(e){let n=e.split(" ").find(e=>e.startsWith("language-"));return n?.replace(/language-/,"")}(o)??p,n?.toLowerCase()),f=g(),b=function(){let[e,n]=(0,i.useState)(!1),[t,s]=(0,i.useState)(!1),r=(0,i.useRef)(null),l=(0,i.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]),c=(0,i.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,i.useState)(),r=(0,i.useCallback)(()=>{s(e.current?.closest("[role=tabpanel][hidden]"))},[e,s]);(0,i.useEffect)(()=>{r()},[r]),!function(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:H,s=(0,q.zX)(n),r=(0,q.Ql)(t);(0,i.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,c),(0,i.useEffect)(()=>{c()},[e,c]),(0,i.useEffect)(()=>(window.addEventListener("resize",c,{passive:!0}),()=>{window.removeEventListener("resize",c)}),[c]),{codeBlockRef:r,isEnabled:e,isCodeScrollable:t,toggle:l}}();let y=(t=a,(t?.match(S)?.groups.title??"")||d),{lineClassNames:v,code:w}=function(e,n){let t=e.replace(/\n$/,""),{language:s,magicComments:r,metastring:l}=n;if(l&&P.test(l)){let e=l.match(P).groups.range;if(0===r.length)throw Error(`A highlight range has been given in code block's metastring (\`\`\` ${l}), 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(D()(e).filter(e=>e>0).map(e=>[e-1,[n]])),code:t}}if(void 0===s)return{lineClassNames:{},code:t};let i=function(e,n){switch(e){case"js":case"javascript":case"ts":case"typescript":return O(["js","jsBlock"],n);case"jsx":case"tsx":return O(["js","jsBlock","jsx"],n);case"html":return O(["js","jsBlock","html"],n);case"python":case"py":case"bash":return O(["bash"],n);case"markdown":case"md":return O(["html","jsx","bash"],n);case"tex":case"latex":case"matlab":return O(["tex"],n);case"lua":case"haskell":case"sql":return O(["lua"],n);case"wasm":return O(["wasm"],n);case"vb":case"vba":case"visual-basic":return O(["vb","rem"],n);case"vbnet":return O(["vbnet","rem"],n);case"batch":return O(["rem"],n);case"basic":return O(["rem","f90"],n);case"fsharp":return O(["js","ml"],n);case"ocaml":case"sml":return O(["ml"],n);case"fortran":return O(["f90"],n);case"cobol":return O(["cobol"],n);default:return O($,n)}}(s,r),c=t.split("\n"),o=Object.fromEntries(r.map(e=>[e.className,{start:0,range:""}])),a=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 void 0!==e);a[t]?o[a[t]].range+=`${e},`:d[t]?o[d[t]].start=e:u[t]&&(o[u[t]].range+=`${o[u[t]].start}-${e-1},`),c.splice(e,1)}t=c.join("\n");let h={};return Object.entries(o).forEach(e=>{let[n,{range:t}]=e;D()(t).forEach(e=>{h[e]??=[],h[e].push(n)})}),{lineClassNames:h,code:t}}(r,{metastring:a,language:m,magicComments:x});let k=u??(s=a,!!s?.includes("showLineNumbers"));return(0,l.jsxs)(F,{as:"div",className:(0,c.Z)(o,m&&!o.includes(`language-${m}`)&&`language-${m}`),children:[y&&(0,l.jsx)("div",{className:W.codeBlockTitle,children:y}),(0,l.jsxs)("div",{className:W.codeBlockContent,children:[(0,l.jsx)(X.y$,{theme:f,code:w,language:m??"text",children:e=>{let{className:n,style:t,tokens:s,getLineProps:r,getTokenProps:i}=e;return(0,l.jsx)("pre",{tabIndex:0,ref:b.codeBlockRef,className:(0,c.Z)(n,W.codeBlock,"thin-scrollbar"),style:t,children:(0,l.jsx)("code",{className:(0,c.Z)(W.codeBlockLines,k&&W.codeBlockLinesWithNumbering),children:s.map((e,n)=>(0,l.jsx)(G,{line:e,getLineProps:r,getTokenProps:i,classNames:v[n],showLineNumbers:k},n))})})}}),(0,l.jsxs)("div",{className:W.buttonGroup,children:[(b.isEnabled||b.isCodeScrollable)&&(0,l.jsx)(es,{className:W.codeButton,onClick:()=>b.toggle(),isEnabled:b.isEnabled}),(0,l.jsx)(ee,{className:W.codeButton,code:w})]})]})]})}let el=(s=function(e){var n;let{children:t,...s}=e,r=(0,o.Z)();let c=(n=t,i.Children.toArray(n).some(e=>(0,i.isValidElement)(e))?n:Array.isArray(n)?n.join(""):n),a="string"==typeof c?er:V;return(0,l.jsx)(a,{...s,children:c},String(r))},function(e){return e.live?(0,l.jsx)(Z,{scope:L,...e}):(0,l.jsx)(s,{...e})});function ei(e){return(0,l.jsx)(el,{...e})}}}]);