mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-02 02:42:41 +02:00
5 lines
No EOL
52 KiB
JavaScript
5 lines
No EOL
52 KiB
JavaScript
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["84429"],{3939:function(e,t,n){n.r(t),n.d(t,{metadata:()=>r,contentTitle:()=>d,default:()=>g,assets:()=>h,toc:()=>b,frontMatter:()=>u});var r=JSON.parse('{"type":"mdx","permalink":"/tests/pages/code-block-tests","source":"@site/_dogfooding/_pages tests/code-block-tests.mdx","title":"Code block tests","description":"This test page is quite outdated: MDX v2 lowercase tags are not substituted anymore in the same way as they were in v1.","frontMatter":{},"lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1728655362000,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/_dogfooding/_pages tests/code-block-tests.mdx","unlisted":false}'),o=n("24246"),s=n("80980"),c=n("95998"),l=n("14522"),i=n("15398"),a=n("58636");let u={},d="Code block tests",h={},b=[{value:"Code block prism language tests",id:"code-block-prism-language-tests",level:2},{value:"<code>pre</code>",id:"pre",level:2},{value:"<code>pre > string</code>",id:"pre--string",level:3},{value:"<code>pre > string[]</code>",id:"pre--string-1",level:3},{value:"<code>pre > element</code>",id:"pre--element",level:3},{value:"<code>pre > element[]</code>",id:"pre--element-1",level:3},{value:"<code>pre > code > element</code>",id:"pre--code--element",level:3},{value:"<code>code</code>",id:"code",level:2},{value:"<code>code > string</code>",id:"code--string",level:3},{value:"<code>code > string[]</code>",id:"code--string-1",level:3},{value:"<code>code > element</code>",id:"code--element",level:3},{value:"<code>code > element[]</code>",id:"code--element-1",level:3},{value:"<code>CodeBlock</code>",id:"codeblock",level:2},{value:"<code>CodeBlock > string</code>",id:"codeblock--string",level:3},{value:"<code>CodeBlock > string[]</code>",id:"codeblock--string-1",level:3},{value:"<code>CodeBlock > element</code>",id:"codeblock--element",level:3},{value:"<code>CodeBlock > element[]</code>",id:"codeblock--element-1",level:3},{value:"Code blocks with line numbering tests",id:"code-blocks-with-line-numbering-tests",level:2},{value:"Code block wrapping tests",id:"code-block-wrapping-tests",level:2},{value:"Magic comments tests",id:"magic-comments-tests",level:2},{value:"HTML - script + style highlighting",id:"html---script--style-highlighting",level:2},{value:"Empty code blocks edge cases",id:"empty-code-blocks-edge-cases",level:2}];function p(e){let t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.header,{children:(0,o.jsx)(t.h1,{id:"code-block-tests",children:"Code block tests"})}),"\n",(0,o.jsx)(t.admonition,{title:"legacy test page - MDX v1",type:"danger",children:(0,o.jsx)(t.p,{children:"This test page is quite outdated: MDX v2 lowercase tags are not substituted anymore in the same way as they were in v1."})}),"\n",(0,o.jsx)(t.hr,{}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-java",children:'class HelloWorld {\n public static void main(String args[]) {\n System.out.println("Hello, World");\n }\n}\n'})}),"\n",(0,o.jsx)(t.p,{children:"See:"}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.a,{href:"https://github.com/facebook/docusaurus/pull/1584",children:"https://github.com/facebook/docusaurus/pull/1584"})}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.a,{href:"https://github.com/facebook/docusaurus/pull/3749",children:"https://github.com/facebook/docusaurus/pull/3749"})}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.a,{href:"https://github.com/facebook/docusaurus/pull/6177",children:"https://github.com/facebook/docusaurus/pull/6177"})}),"\n"]}),"\n",(0,o.jsx)(t.h2,{id:"code-block-prism-language-tests",children:"Code block prism language tests"}),"\n",(0,o.jsxs)(t.p,{children:["Code block with/without the good prism language case(lower or upper) in ",(0,o.jsx)(t.code,{children:"additionalLanguages[]"})]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-php",metastring:'title="php"',children:'<?php\n$x=15;\n$y=30;\n$z=$x+$y;\necho "Sum: ",$z;\n?>\n'})}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-PHP",metastring:'title="PHP"',children:'<?php\n$x=15;\n$y=30;\n$z=$x+$y;\necho "Sum: ",$z;\n?>\n'})}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-pHp",metastring:'title="pHp"',children:'<?php\n$x=15;\n$y=30;\n$z=$x+$y;\necho "Sum: ",$z;\n?>\n'})}),"\n",(0,o.jsx)(t.p,{children:"See:"}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.a,{href:"https://github.com/facebook/docusaurus/pull/9183",children:"https://github.com/facebook/docusaurus/pull/9183"})}),"\n"]}),"\n",(0,o.jsx)(t.h2,{id:"pre",children:(0,o.jsx)(t.code,{children:"pre"})}),"\n",(0,o.jsx)(t.h3,{id:"pre--string",children:(0,o.jsx)(t.code,{children:"pre > string"})}),"\n",(0,o.jsxs)(t.p,{children:["Multi-line text inside ",(0,o.jsx)(t.code,{children:"pre"})," will turn into one-liner, but it's okay (",(0,o.jsx)(t.a,{href:"https://github.com/mdx-js/mdx/issues/1095",children:"https://github.com/mdx-js/mdx/issues/1095"}),")"]}),"\n",(0,o.jsx)("pre",{children:"1 2 3"}),"\n","\n",(0,o.jsx)("pre",{children:(0,o.jsx)(t.p,{children:"1\n2\n3"})}),"\n",(0,o.jsx)(t.h3,{id:"pre--string-1",children:(0,o.jsx)(t.code,{children:"pre > string[]"})}),"\n",(0,o.jsx)("pre",{children:(0,o.jsxs)(t.p,{children:["1","\n","2","\n","3","\n"]})}),"\n",(0,o.jsx)(t.h3,{id:"pre--element",children:(0,o.jsx)(t.code,{children:"pre > element"})}),"\n",(0,o.jsx)("pre",{children:(0,o.jsx)(l.Z,{children:"Lol bro"})}),"\n",(0,o.jsx)(t.h3,{id:"pre--element-1",children:(0,o.jsx)(t.code,{children:"pre > element[]"})}),"\n",(0,o.jsxs)("pre",{children:[(0,o.jsx)("a",{href:"/",children:"Front page"}),"\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)("strong",{children:"Input: "}),'a = "abcd", b = "cdabcdab"',"\n","\n",(0,o.jsx)("strong",{children:"Output: "}),"3","\n","\n",(0,o.jsx)("strong",{children:"Explanation: "}),'a after three repetitions become "ab\n',(0,o.jsx)("strong",{children:"cdabcdab"}),'cd", at which time b is a substring.',"\n"]})]}),"\n",(0,o.jsx)(t.h3,{id:"pre--code--element",children:(0,o.jsx)(t.code,{children:"pre > code > element"})}),"\n",(0,o.jsx)("pre",{children:(0,o.jsx)("code",{children:(0,o.jsx)("b",{children:"Hey bro"})})}),"\n",(0,o.jsx)(t.h2,{id:"code",children:(0,o.jsx)(t.code,{children:"code"})}),"\n",(0,o.jsx)(t.h3,{id:"code--string",children:(0,o.jsx)(t.code,{children:"code > string"})}),"\n",(0,o.jsx)("code",{children:"1 2 3"}),"\n",(0,o.jsx)("code",{children:`link:
|
|
title: front page
|
|
path: /docs/`}),"\n",(0,o.jsx)(t.h3,{id:"code--string-1",children:(0,o.jsx)(t.code,{children:"code > string[]"})}),"\n",(0,o.jsx)("code",{children:(0,o.jsxs)(t.p,{children:["link:"," \n","\n"," ","title: front page","\n","\n"," ","path: /docs/","\n"]})}),"\n",(0,o.jsx)(t.h3,{id:"code--element",children:(0,o.jsx)(t.code,{children:"code > element"})}),"\n",(0,o.jsx)("code",{children:(0,o.jsx)(l.Z,{children:"Lol bro"})}),"\n",(0,o.jsx)(t.h3,{id:"code--element-1",children:(0,o.jsx)(t.code,{children:"code > element[]"})}),"\n",(0,o.jsxs)("code",{children:[(0,o.jsx)("a",{href:"/",children:"Front page"}),(0,o.jsx)("br",{}),(0,o.jsxs)(t.p,{children:[(0,o.jsx)("strong",{children:"Input: "}),'a = "abcd", b = "cdabcdab"']}),(0,o.jsx)("br",{}),(0,o.jsxs)(t.p,{children:[(0,o.jsx)("strong",{children:"Output: "}),"3",(0,o.jsx)("br",{}),"\n",(0,o.jsx)("strong",{children:"Explanation: "}),'a after three repetitions become "ab',(0,o.jsx)("strong",{children:"\ncdabcdab\n"}),'cd", at which time b is a substring.']}),(0,o.jsx)("br",{})]}),"\n",(0,o.jsx)(t.h2,{id:"codeblock",children:(0,o.jsx)(t.code,{children:"CodeBlock"})}),"\n",(0,o.jsx)(t.h3,{id:"codeblock--string",children:(0,o.jsx)(t.code,{children:"CodeBlock > string"})}),"\n",(0,o.jsx)(c.Z,{children:"1 2 3"}),"\n",(0,o.jsx)(c.Z,{className:"language-yaml",title:"test",children:`link:
|
|
title: front page
|
|
path: /docs/`}),"\n",(0,o.jsx)(t.h3,{id:"codeblock--string-1",children:(0,o.jsx)(t.code,{children:"CodeBlock > string[]"})}),"\n",(0,o.jsx)(c.Z,{className:"language-yaml",title:"test",children:(0,o.jsxs)(t.p,{children:["link:","\n","\n"," ","title: front page","\n","\n"," ","path: /docs/","\n"]})}),"\n",(0,o.jsx)(t.h3,{id:"codeblock--element",children:(0,o.jsx)(t.code,{children:"CodeBlock > element"})}),"\n",(0,o.jsx)(c.Z,{className:"language-yaml",title:"test",children:(0,o.jsx)(l.Z,{children:"Lol bro"})}),"\n",(0,o.jsx)(t.h3,{id:"codeblock--element-1",children:(0,o.jsx)(t.code,{children:"CodeBlock > element[]"})}),"\n",(0,o.jsxs)(c.Z,{className:"language-yaml",title:"test",children:[(0,o.jsx)("a",{href:"/",children:"Front page"}),(0,o.jsx)("br",{}),(0,o.jsxs)(t.p,{children:[(0,o.jsx)("strong",{children:"Input: "}),'a = "abcd", b = "cdabcdab"']}),(0,o.jsx)("br",{}),(0,o.jsxs)(t.p,{children:[(0,o.jsx)("strong",{children:"Output: "}),"3",(0,o.jsx)("br",{}),"\n",(0,o.jsx)("strong",{children:"Explanation: "}),'a after three repetitions become "ab',(0,o.jsx)("strong",{children:"\ncdabcdab\n"}),'cd", at which time b is a substring.']}),(0,o.jsx)("br",{})]}),"\n",(0,o.jsx)(t.h2,{id:"code-blocks-with-line-numbering-tests",children:"Code blocks with line numbering tests"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-jsx",children:'function PageLayout(props) {\n // highlight-next-line\n return <Layout title="Awesome Docusaurus page" description="Test Test Test Test Test Test Test Test Test Test Test Test Test Test ">;\n}\n'})}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-jsx",metastring:"showLineNumbers",children:'function PageLayout(props) {\n // highlight-next-line\n return <Layout title="Awesome Docusaurus page" description="Test Test Test Test Test Test Test Test Test Test Test Test Test Test ">;\n}\n'})}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-jsx",metastring:"{1,3,6} showLineNumbers",children:"function PageLayout(props) {\n console.log(\n 'Test Test Test Test Test Test Test Test Test Test Test Test Test Test ',\n );\n console.log(\n 'Test Test Test Test Test Test Test Test Test Test Test Test Test Test ',\n );\n console.log(\n 'Test Test Test Test Test Test Test Test Test Test Test Test Test Test ',\n );\n console.log(\n 'Test Test Test Test Test Test Test Test Test Test Test Test Test Test ',\n );\n console.log(\n 'Test Test Test Test Test Test Test Test Test Test Test Test Test Test ',\n );\n console.log(\n 'Test Test Test Test Test Test Test Test Test Test Test Test Test Test ',\n );\n console.log(\n 'Test Test Test Test Test Test Test Test Test Test Test Test Test Test ',\n );\n console.log(\n 'Test Test Test Test Test Test Test Test Test Test Test Test Test Test ',\n );\n console.log(\n 'Test Test Test Test Test Test Test Test Test Test Test Test Test Test ',\n );\n}\n"})}),"\n",(0,o.jsx)(t.h2,{id:"code-block-wrapping-tests",children:"Code block wrapping tests"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:'mkdir this_is_a_loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_string_to_test_code_block_wrapping\necho "this is a long string made up of many separate words that should be broken between words when possible"\ncurl https://docusaurus.io/tests/pages/code-block-tests\n'})}),"\n",(0,o.jsxs)(i.Z,{children:[(0,o.jsx)(a.Z,{value:"short-tab-1",label:"Short tab",children:(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:'echo "hi"\n'})})}),(0,o.jsx)(a.Z,{value:"long-tab",label:"Long tab",children:(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"echo this will test whether a long string that is initially hidden will have the option to wrap when made visible\n"})})}),(0,o.jsx)(a.Z,{value:"short-tab-2",label:"Short tab",children:(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"rm short_initially_hidden_string\n"})})})]}),"\n",(0,o.jsxs)(i.Z,{children:[(0,o.jsx)(a.Z,{value:"long-tab",label:"Long tab",children:(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"echo medium_length_string_will_have_the_option_to_wrap_after_window_resized_while_it_is_hidden\n"})})}),(0,o.jsx)(a.Z,{value:"short-tab",label:"Short tab",children:(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:'echo "short_initially_hidden_string"\n'})})})]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-jsx",metastring:"showLineNumbers",children:"import React from 'react';\nimport Layout from '@theme/Layout';\n\nexport default function MyReactPage() {\n return (\n <Layout>\n <h1>My React page</h1>\n <p>\n This is a React page. Let's make this sentence bit long. Some more words\n to make sure... Some more words to make sure... Some more words to make\n sure...\n </p>\n </Layout>\n );\n}\n"})}),"\n",(0,o.jsx)(t.h2,{id:"magic-comments-tests",children:"Magic comments tests"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-lua",metastring:'title="lua_sum.lua"',children:"function sum(n)\n -- highlight-next-line\n local result = 0\n for i = 1, n do\n -- highlight-start\n result = result + i\n end\n -- highlight-end\n print(result)\nend\n"})}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-haskell",metastring:'title="haskell.hs"',children:"stringLength :: String -> Int\n-- highlight-next-line\nstringLength [] = 0\nstringLength (x:xs) = 1 + stringLength xs\n"})}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-wasm",metastring:'title="sum_webAssembly.wasm"',children:'(module\n ;; highlight-next-line\n (func $add (param $a i32) (param $b i32) (result i32)\n local.get $a\n ;; highlight-start\n local.get $b\n i32.add)\n ;; highlight-end\n (export "add" (func $add)))\n'})}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-sql",metastring:'title="sql_query.sql"',children:"-- highlight-start\nSELECT *\nFROM orders\n-- highlight-end\nWHERE customer_id IN (\n SELECT customer_id\n -- highlight-next-line\n FROM customers\n WHERE country = 'USA'\n)\n"})}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-matlab",metastring:'title="matlab.m"',children:"% highlight-start\nfunction result = times2(n)\n result = n * 2;\nend\n% highlight-end\n\nx = 10;\n% highlight-next-line\ny = times2(x);\n"})}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-latex",metastring:'title="latex.tex"',children:"\\begin{document}\n \\section{Triangles}\n % highlight-next-line\n \\subsection{Pythagoras' Theorem}\n Pythagoras's theorem is:\n % highlight-start\n \\begin{equation}\n c^2 = a^2 + b^2\n \\end{equation}\n % highlight-end\n\\end{document}\n"})}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-vba",metastring:'title="vba.vb"',children:"Function Factorial(ByVal n As Long) As Long\n If n < 0 Then\n Err.Raise 5 ' Invalid argument\n End If\n 'highlight-next-line\n Factorial = 1 ' return value\n Dim i As Long\n ' highlight-start\n For i = 2 To n\n Factorial = Factorial * i\n Next\n ' highlight-end\nEnd Function\n"})}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-vbnet",metastring:'title="vbnet.vb"',children:'\' highlight-next-line\nDim languages As New HashSet(Of String) From {\n "C#",\n "Visual Basic",\n _ \' highlight-start\n "F#",\n "PowerShell",\n "TypeScript"\n _\' highlight-end\n}\n'})}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-batch",metastring:'title="cmd.bat"',children:"rem highlight-start\n@echo off\nsetlocal\nRem highlight-end\nipconfig\nREM highlight-next-line\necho Docusaurus is awesome\nnetstat\n"})}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-fortran",metastring:'title="fortran.f90"',children:'! highlight-start\nprogram hello\n! highlight-end\n implicit none\n ! highlight-next-line\n print *, "Hello, World!"\nend program hello\n'})}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-cobol",metastring:'title="cobol.cob"',children:'*> highlight-start\nIDENTIFICATION DIVISION.\nPROGRAM-ID. HELLO.\n*> highlight-end\nPROCEDURE DIVISION.\n *> highlight-next-line\n DISPLAY "Hello, World!".\nEND PROGRAM HELLO.\n'})}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-fsharp",metastring:'title="fsharp.fsx"',children:'(* highlight-start *)\n[<EntryPoint>]\n(* highlight-end *)\nlet main _ =\n // highlight-next-line\n printfn "Hello, World!"\n 0\n'})}),"\n",(0,o.jsx)(t.h2,{id:"html---script--style-highlighting",children:"HTML - script + style highlighting"}),"\n",(0,o.jsxs)(t.p,{children:["See ",(0,o.jsx)(t.a,{href:"https://github.com/facebook/docusaurus/issues/9517",children:"https://github.com/facebook/docusaurus/issues/9517"})]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-html",children:"<html lang=\"en\">\n <head>\n <script>\n const name = 'Formidable';\n console.log(name);\n <\/script>\n <style>\n .some-class {\n border: solid red thick;\n }\n </style>\n </head>\n</html>\n"})}),"\n",(0,o.jsx)(t.h2,{id:"empty-code-blocks-edge-cases",children:"Empty code blocks edge cases"}),"\n",(0,o.jsx)(t.p,{children:"Empty inline code block: ``"}),"\n",(0,o.jsxs)(t.p,{children:["Single space inline code block: ",(0,o.jsx)(t.code,{children:" "})]}),"\n",(0,o.jsx)(t.p,{children:"Empty code block"}),"\n","\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{})}),"\n",(0,o.jsx)(t.p,{children:"Empty 1 line code block"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{})}),"\n",(0,o.jsx)(t.p,{children:"Empty 2 line code block"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{})}),"\n",(0,o.jsx)(t.p,{children:"Empty live code block"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-js",metastring:"live",live:!0})})]})}function g(e={}){let{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(p,{...e})}):p(e)}},58636:function(e,t,n){n.d(t,{Z:()=>c});var r=n("24246");n("27378");var o=n("90496");let s="tabItem_pnkT";function c(e){var t=e.children,n=e.hidden,c=e.className;return(0,r.jsx)("div",{role:"tabpanel",className:(0,o.Z)(s,c),hidden:n,children:t})}},15398:function(e,t,n){n.d(t,{Z:()=>T});var r=n("24246"),o=n("27378"),s=n("90496"),c=n("54947"),l=n("3620"),i=n("844"),a=n("97486"),u=n("32263"),d=n("16971");function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var s=[],c=!0,l=!1;try{for(o=o.call(e);!(c=(n=o.next()).done)&&(s.push(n.value),!t||s.length!==t);c=!0);}catch(e){l=!0,r=e}finally{try{!c&&null!=o.return&&o.return()}finally{if(l)throw r}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e){var t,n;return null!==(n=null===(t=o.Children.toArray(e).filter(function(e){return"\n"!==e}).map(function(e){var t,n;if(!e||(0,o.isValidElement)(e)&&(t=e.props)&&(void 0===t?"undefined":(n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)=="object"&&"value"in t)return e;throw Error("Docusaurus error: Bad <Tabs> child <".concat("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.'))}))||void 0===t?void 0:t.filter(Boolean))&&void 0!==n?n:[]}function g(e){var t=e.value;return e.tabValues.some(function(e){return e.value===t})}var f=n("71607");let m="tabList_Qoir",j="tabItem_AQgk";function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,s;r=e,o=t,s=n[t],o in r?Object.defineProperty(r,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[o]=s})}return e}function v(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function x(e){var t=e.className,n=e.block,o=e.selectedValue,l=e.selectValue,i=e.tabValues,a=[],u=(0,c.o5)().blockElementScrollPositionUntilNextRender,d=function(e){var t=e.currentTarget,n=i[a.indexOf(t)].value;n!==o&&(u(t),l(n))},h=function(e){var t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":var n,r=a.indexOf(e.currentTarget)+1;t=null!==(n=a[r])&&void 0!==n?n:a[0];break;case"ArrowLeft":var o,s=a.indexOf(e.currentTarget)-1;t=null!==(o=a[s])&&void 0!==o?o:a[a.length-1]}null==t||t.focus()};return(0,r.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.Z)("tabs",{"tabs--block":n},t),children:i.map(function(e){var t=e.value,n=e.label,c=e.attributes;return(0,r.jsx)("li",v(y({role:"tab",tabIndex:o===t?0:-1,"aria-selected":o===t,ref:function(e){return a.push(e)},onKeyDown:h,onClick:d},c),{className:(0,s.Z)("tabs__item",j,null==c?void 0:c.className,{"tabs__item--active":o===t}),children:null!=n?n:t}),t)})})}function O(e){var t=e.lazy,n=e.children,c=e.selectedValue,l=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){var i=l.find(function(e){return e.props.value===c});return i?(0,o.cloneElement)(i,{className:(0,s.Z)("margin-top--md",i.props.className)}):null}return(0,r.jsx)("div",{className:"margin-top--md",children:l.map(function(e,t){return(0,o.cloneElement)(e,{key:t,hidden:e.props.value!==c})})})}function w(e){var t=function(e){var t,n,r,s,c,h,f,m,j,y,v,x,O,w,T=e.defaultValue,k=e.queryString,P=e.groupId;var S=(n=(t=e).values,r=t.children,(0,o.useMemo)(function(){var e=null!=n?n:p(r).map(function(e){var t=e.props;return{value:t.value,label:t.label,attributes:t.attributes,default:t.default}});return!function(e){var t=(0,u.lx)(e,function(e,t){return e.value===t.value});if(t.length>0)throw Error('Docusaurus error: Duplicate values "'.concat(t.map(function(e){return e.value}).join(", "),'" found in <Tabs>. Every value needs to be unique.'))}(e),e},[n,r])),N=b((0,o.useState)(function(){return function(e){var t,n=e.defaultValue,r=e.tabValues;if(0===r.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(n){if(!g({value:n,tabValues:r}))throw Error('Docusaurus error: The <Tabs> has a defaultValue "'.concat(n,'" but none of its children has the corresponding value. Available values are: ').concat(r.map(function(e){return e.value}).join(", "),". If you intend to show no default tab, use defaultValue={null} instead."));return n}var o=null!==(t=r.find(function(e){return e.default}))&&void 0!==t?t:r[0];if(!o)throw Error("Unexpected error: 0 tabValues");return o.value}({defaultValue:T,tabValues:S})}),2),E=N[0],C=N[1];var _=b((c=(s={queryString:void 0!==k&&k,groupId:P}).queryString,h=s.groupId,f=(0,l.k6)(),m=function(e){var t=e.queryString,n=void 0!==t&&t,r=e.groupId;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!r)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 null!=r?r:null}({queryString:void 0!==c&&c,groupId:h}),[(0,a._X)(m),(0,o.useCallback)(function(e){if(!!m){var t,n,r=new URLSearchParams(f.location.search);r.set(m,e),f.replace((t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,s;r=e,o=t,s=n[t],o in r?Object.defineProperty(r,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[o]=s})}return e}({},f.location),n=(n={search:r.toString()},n),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}},[m,f])]),2),L=_[0],B=_[1];var D=b((y=(j=({groupId:P}).groupId)?"docusaurus.tab.".concat(j):null,x=(v=b((0,d.Nk)(y),2))[0],O=v[1],[x,(0,o.useCallback)(function(e){if(!!y)O.set(e)},[y,O])]),2),I=D[0],A=D[1];var Z=g({value:w=null!=L?L:I,tabValues:S})?w:null;return(0,i.Z)(function(){Z&&C(Z)},[Z]),{selectedValue:E,selectValue:(0,o.useCallback)(function(e){if(!g({value:e,tabValues:S}))throw Error("Can't select invalid tab value=".concat(e));C(e),B(e),A(e)},[B,A,S]),tabValues:S}}(e);return(0,r.jsxs)("div",{className:(0,s.Z)("tabs-container",m),children:[(0,r.jsx)(x,y({},t,e)),(0,r.jsx)(O,y({},t,e))]})}function T(e){var t=(0,f.Z)();return(0,r.jsx)(w,v(y({},e),{children:p(e.children)}),String(t))}},56497:function(e,t,n){n.d(t,{Z:function(){return s}});var r=n(24246);n(27378);var o=n(71607);function s(e){var t=e.children,n=e.fallback;return(0,o.Z)()?(0,r.jsx)(r.Fragment,{children:null==t?void 0:t()}):null!=n?n:null}},14522:function(e,t,n){n.d(t,{Z:()=>b});var r=n("24246");n("27378");var o=n("90496");let s="browserWindow_my1Q",c="browserWindowHeader_jXSR",l="buttons_uHc7",i="browserWindowAddressBar_Pd8y",a="dot_giz1",u="browserWindowMenuIcon_Vhuh",d="bar_rrRL",h="browserWindowBody_Idgs";function b(e){var t,n,b=e.children,p=e.minHeight,g=e.url,f=e.style,m=e.bodyStyle;return(0,r.jsxs)("div",{className:s,style:(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,s;r=e,o=t,s=n[t],o in r?Object.defineProperty(r,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[o]=s})}return e}({},f),n=(n={minHeight:p},n),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t),children:[(0,r.jsxs)("div",{className:c,children:[(0,r.jsxs)("div",{className:l,children:[(0,r.jsx)("span",{className:a,style:{background:"#f25f58"}}),(0,r.jsx)("span",{className:a,style:{background:"#fbbe3c"}}),(0,r.jsx)("span",{className:a,style:{background:"#58cb42"}})]}),(0,r.jsx)("div",{className:(0,o.Z)(i,"text--truncate"),children:void 0===g?"http://localhost:3000":g}),(0,r.jsx)("div",{className:u,children:(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:d}),(0,r.jsx)("span",{className:d}),(0,r.jsx)("span",{className:d})]})})]}),(0,r.jsx)("div",{className:h,style:m,children:b})]})}},95998:function(e,t,n){n.d(t,{Z:()=>em});var r,o,s,c={};n.r(c),n.d(c,{ButtonExample:()=>D});var l=n("24246"),i=n("27378"),a=n("90496"),u=n("71607"),d=n("10075"),h=n("77827"),b=n("8156"),p=n("56497"),g=n("85108"),f=n("45245"),m=n("26378");function j(){var e=(0,m.L)().prism,t=(0,f.I)().colorMode,n=e.theme,r=e.darkTheme||n;return"dark"===t?r:n}var y=n("67490");let v="playgroundContainer_6Ior",x="playgroundHeader_Tvsk",O="playgroundEditor_TySg",w="playgroundPreview_mApW";function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,s;r=e,o=t,s=n[t],o in r?Object.defineProperty(r,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[o]=s})}return e}function k(e){var t=e.children;return(0,l.jsx)("div",{className:(0,a.Z)(x),children:t})}function P(){return(0,l.jsx)("div",{children:"Loading..."})}function S(){return(0,l.jsx)(p.Z,{fallback:(0,l.jsx)(P,{}),children:function(){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(y.Z,{fallback:function(e){return(0,l.jsx)(g.Ac,T({},e))},children:(0,l.jsx)(d.i5,{})}),(0,l.jsx)(d.IF,{})]})}})}function N(){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(k,{children:(0,l.jsx)(h.Z,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,l.jsx)("div",{className:w,children:(0,l.jsx)(S,{})})]})}function E(){var e=(0,u.Z)();return(0,l.jsx)(d.uz,{className:O},String(e))}function C(){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(k,{children:(0,l.jsx)(h.Z,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,l.jsx)(E,{})]})}var _=function(e){return"".concat(e,";")};function L(e){var t,n,r,o,s=e.children,c=e.transformCode,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++){if(n=s[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(e,["children","transformCode"]),a=(0,b.Z)().siteConfig.themeConfig.liveCodeBlock.playgroundPosition,u=j(),h=null!==(o=null===(r=i.metastring)||void 0===r?void 0:r.includes("noInline"))&&void 0!==o&&o;return(0,l.jsx)("div",{className:v,children:(0,l.jsx)(d.nu,(t=T({code:null==s?void 0:s.replace(/\n$/,""),noInline:h,transformCode:null!=c?c:_,theme:u},i),n=(n={children:"top"===a?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(N,{}),(0,l.jsx)(C,{})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(C,{}),(0,l.jsx)(N,{})]})},n),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))})}function B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,s;r=e,o=t,s=n[t],o in r?Object.defineProperty(r,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[o]=s})}return e}function D(e){var t,n;return(0,l.jsx)("button",(t=B({type:"button"},e),n=(n={style:B({backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer"},e.style)},n),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}let I=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,s;r=e,o=t,s=n[t],o in r?Object.defineProperty(r,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[o]=s})}return e}({React:i},i,c);var A=n("55951"),Z=n("6324"),R=n.n(Z);function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function M(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var s=[],c=!0,l=!1;try{for(o=o.call(e);!(c=(n=o.next()).done)&&(s.push(n.value),!t||s.length!==t);c=!0);}catch(e){l=!0,r=e}finally{try{!c&&null!=o.return&&o.return()}finally{if(l)throw r}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return H(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return H(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var V=RegExp("title=(?<quote>[\"'])(?<title>.*?)\\1"),$=RegExp("\\{(?<range>[\\d,-]+)\\}"),F={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}};var W=(r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,s;r=e,o=t,s=n[t],o in r?Object.defineProperty(r,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[o]=s})}return e}({},F),o=(o={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:""}},o),Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}),r),q=Object.keys(F);function z(e,t){var n=e.map(function(e){var n=W[e],r=n.start,o=n.end;return"(?:".concat(r,"\\s*(").concat(t.flatMap(function(e){var t,n;return[e.line,null===(t=e.block)||void 0===t?void 0:t.start,null===(n=e.block)||void 0===n?void 0:n.end].filter(Boolean)}).join("|"),")\\s*").concat(o,")")}).join("|");return new RegExp("^\\s*(?:".concat(n,")\\s*$"))}let U="codeBlockContainer_jDV4";function G(e){var t,n,r,o,s=e.as,c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++){if(n=s[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(e,["as"]);var i=(t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={},Object.entries(j().plain).forEach(function(e){var r=M(e,2),o=r[0],s=r[1],c=t[o];c&&"string"==typeof s&&(n[c]=s)}),n);return(0,l.jsx)(s,(r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,s;r=e,o=t,s=n[t],o in r?Object.defineProperty(r,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[o]=s})}return e}({},c),o=(o={style:i,className:(0,a.Z)(c.className,U,A.k.common.codeBlock)},o),Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}),r))}let X={codeBlockContent:"codeBlockContent_vx7S",codeBlockTitle:"codeBlockTitle_bdru",codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q",buttonGroup:"buttonGroup_cUGO"};function Q(e){var t=e.children,n=e.className;return(0,l.jsx)(G,{as:"pre",tabIndex:0,className:(0,a.Z)(X.codeBlockStandalone,"thin-scrollbar",n),children:(0,l.jsx)("code",{className:X.codeBlockLines,children:t})})}var J=n("50923"),Y={attributes:!0,characterData:!0,childList:!0,subtree:!0};function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ee(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var s=[],c=!0,l=!1;try{for(o=o.call(e);!(c=(n=o.next()).done)&&(s.push(n.value),!t||s.length!==t);c=!0);}catch(e){l=!0,r=e}finally{try{!c&&null!=o.return&&o.return()}finally{if(l)throw r}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return K(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return K(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var et=n("7316");let en={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function er(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,s;r=e,o=t,s=n[t],o in r?Object.defineProperty(r,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[o]=s})}return e}function eo(e){var t,n,r=e.line,o=e.classNames,s=e.showLineNumbers,c=e.getLineProps,i=e.getTokenProps;1===r.length&&"\n"===r[0].content&&(r[0].content="");var u=c({line:r,className:(0,a.Z)(o,s&&en.codeLine)}),d=r.map(function(e,t){return(0,l.jsx)("span",er({},i({token:e})),t)});return(0,l.jsxs)("span",(t=er({},u),n=(n={children:[s?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:en.codeLineNumber}),(0,l.jsx)("span",{className:en.codeLineContent,children:d})]}):d,(0,l.jsx)("br",{})]},n),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}var es=n("44771");function ec(e){var t,n;return(0,l.jsx)("svg",(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,s;r=e,o=t,s=n[t],o in r?Object.defineProperty(r,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[o]=s})}return e}({viewBox:"0 0 24 24"},e),n=(n={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"})},n),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}function el(e){var t,n;return(0,l.jsx)("svg",(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,s;r=e,o=t,s=n[t],o in r?Object.defineProperty(r,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[o]=s})}return e}({viewBox:"0 0 24 24"},e),n=(n={children:(0,l.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})},n),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}let ei={copyButtonCopied:"copyButtonCopied_OkN_",copyButtonIcons:"copyButtonIcons_OqsO",copyButtonIcon:"copyButtonIcon_PgCn",copyButtonSuccessIcon:"copyButtonSuccessIcon_bsQG"};function ea(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function eu(e){var t,n,r=e.code,o=e.className;var s=(t=(0,i.useState)(!1),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var s=[],c=!0,l=!1;try{for(o=o.call(e);!(c=(n=o.next()).done)&&(s.push(n.value),!t||s.length!==t);c=!0);}catch(e){l=!0,r=e}finally{try{!c&&null!=o.return&&o.return()}finally{if(l)throw r}}return s}}(t,2)||function(e,t){if(e){if("string"==typeof e)return ea(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ea(e,t)}}(t,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=s[0],u=s[1],d=(0,i.useRef)(void 0),b=(0,i.useCallback)(function(){(0,es.Z)(r),u(!0),d.current=window.setTimeout(function(){u(!1)},1e3)},[r]);return(0,i.useEffect)(function(){return function(){return window.clearTimeout(d.current)}},[]),(0,l.jsx)("button",{type:"button","aria-label":c?(0,h.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,h.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,h.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,a.Z)("clean-btn",o,ei.copyButton,c&&ei.copyButtonCopied),onClick:b,children:(0,l.jsxs)("span",{className:ei.copyButtonIcons,"aria-hidden":"true",children:[(0,l.jsx)(ec,{className:ei.copyButtonIcon}),(0,l.jsx)(el,{className:ei.copyButtonSuccessIcon})]})})}function ed(e){var t,n;return(0,l.jsx)("svg",(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,s;r=e,o=t,s=n[t],o in r?Object.defineProperty(r,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[o]=s})}return e}({viewBox:"0 0 24 24"},e),n=(n={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"})},n),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}let eh={wordWrapButtonIcon:"wordWrapButtonIcon_MQXS",wordWrapButtonEnabled:"wordWrapButtonEnabled_TBIH"};function eb(e){var t=e.className,n=e.onClick,r=e.isEnabled,o=(0,h.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:n,className:(0,a.Z)("clean-btn",t,r&&eh.wordWrapButtonEnabled),"aria-label":o,title:o,children:(0,l.jsx)(ed,{className:eh.wordWrapButtonIcon,"aria-hidden":"true"})})}function ep(e){var t,n,r,o,s,c,u,d,h,b,p,g,f,y,v,x,O,w,T,k,P,S,N=e.children,E=e.className,C=void 0===E?"":E,_=e.metastring,L=e.title,B=e.showLineNumbers,D=e.language,I=(0,m.L)().prism,A=I.defaultLanguage,Z=I.magicComments;var H=null==(n=null!==(S=null!=D?D:null==(t=C.split(" ").find(function(e){return e.startsWith("language-")}))?void 0:t.replace(/language-/,""))&&void 0!==S?S:A)?void 0:n.toLowerCase(),F=j();var W=(o=(r=ee((0,i.useState)(!1),2))[0],s=r[1],u=(c=ee((0,i.useState)(!1),2))[0],d=c[1],h=(0,i.useRef)(null),b=(0,i.useCallback)(function(){var e=h.current.querySelector("code");o?e.removeAttribute("style"):(e.style.whiteSpace="pre-wrap",e.style.overflowWrap="anywhere"),s(function(e){return!e})},[h,o]),p=(0,i.useCallback)(function(){var e=h.current;d(e.scrollWidth>e.clientWidth||h.current.querySelector("code").hasAttribute("style"))},[h]),g=h,f=p,v=(y=ee((0,i.useState)(),2))[0],x=y[1],O=(0,i.useCallback)(function(){var e;x(null===(e=g.current)||void 0===e?void 0:e.closest("[role=tabpanel][hidden]"))},[g,x]),(0,i.useEffect)(function(){O()},[O]),function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Y,r=(0,J.zX)(t),o=(0,J.Ql)(n);(0,i.useEffect)(function(){var t=new MutationObserver(r);return e&&t.observe(e,o),function(){return t.disconnect()}},[e,r,o])}(v,function(e){e.forEach(function(e){"attributes"===e.type&&"hidden"===e.attributeName&&(f(),O())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1}),(0,i.useEffect)(function(){p()},[o,p]),(0,i.useEffect)(function(){return window.addEventListener("resize",p,{passive:!0}),function(){window.removeEventListener("resize",p)}},[p]),{codeBlockRef:h,isEnabled:o,isCodeScrollable:u,toggle:b});var U=(null!==(k=null==(w=_)?void 0:null===(T=w.match(V))||void 0===T?void 0:T.groups.title)&&void 0!==k?k:"")||L,Q=function(e,t){var n=e.replace(/\n$/,""),r=t.language,o=t.magicComments,s=t.metastring;if(s&&$.test(s)){var c=s.match($).groups.range;if(0===o.length)throw Error("A highlight range has been given in code block's metastring (``` ".concat(s,"), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges."));var l=o[0].className;return{lineClassNames:Object.fromEntries(R()(c).filter(function(e){return e>0}).map(function(e){return[e-1,[l]]})),code:n}}if(void 0===r)return{lineClassNames:{},code:n};for(var i=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return z(["js","jsBlock"],t);case"jsx":case"tsx":return z(["js","jsBlock","jsx"],t);case"html":return z(["js","jsBlock","html"],t);case"python":case"py":case"bash":return z(["bash"],t);case"markdown":case"md":return z(["html","jsx","bash"],t);case"tex":case"latex":case"matlab":return z(["tex"],t);case"lua":case"haskell":case"sql":return z(["lua"],t);case"wasm":return z(["wasm"],t);case"vb":case"vba":case"visual-basic":return z(["vb","rem"],t);case"vbnet":return z(["vbnet","rem"],t);case"batch":return z(["rem"],t);case"basic":return z(["rem","f90"],t);case"fsharp":return z(["js","ml"],t);case"ocaml":case"sml":return z(["ml"],t);case"fortran":return z(["f90"],t);case"cobol":return z(["cobol"],t);default:return z(q,t)}}(r,o),a=n.split("\n"),u=Object.fromEntries(o.map(function(e){return[e.className,{start:0,range:""}]})),d=Object.fromEntries(o.filter(function(e){return e.line}).map(function(e){var t=e.className;return[e.line,t]})),h=Object.fromEntries(o.filter(function(e){return e.block}).map(function(e){var t=e.className;return[e.block.start,t]})),b=Object.fromEntries(o.filter(function(e){return e.block}).map(function(e){var t=e.className;return[e.block.end,t]})),p=0;p<a.length;){var g=a[p].match(i);if(!g){p+=1;continue}var f=g.slice(1).find(function(e){return void 0!==e});d[f]?u[d[f]].range+="".concat(p,","):h[f]?u[h[f]].start=p:b[f]&&(u[b[f]].range+="".concat(u[b[f]].start,"-").concat(p-1,",")),a.splice(p,1)}n=a.join("\n");var m={};return Object.entries(u).forEach(function(e){var t=M(e,2),n=t[0],r=t[1].range;R()(r).forEach(function(e){var t;null!==(t=m[e])&&void 0!==t||(m[e]=[]),m[e].push(n)})}),{lineClassNames:m,code:n}}(N,{metastring:_,language:H,magicComments:Z}),K=Q.lineClassNames,en=Q.code;var er=null!=B?B:!!(null==(P=_)?void 0:P.includes("showLineNumbers"));return(0,l.jsxs)(G,{as:"div",className:(0,a.Z)(C,H&&!C.includes("language-".concat(H))&&"language-".concat(H)),children:[U&&(0,l.jsx)("div",{className:X.codeBlockTitle,children:U}),(0,l.jsxs)("div",{className:X.codeBlockContent,children:[(0,l.jsx)(et.y$,{theme:F,code:en,language:null!=H?H:"text",children:function(e){var t=e.className,n=e.style,r=e.tokens,o=e.getLineProps,s=e.getTokenProps;return(0,l.jsx)("pre",{tabIndex:0,ref:W.codeBlockRef,className:(0,a.Z)(t,X.codeBlock,"thin-scrollbar"),style:n,children:(0,l.jsx)("code",{className:(0,a.Z)(X.codeBlockLines,er&&X.codeBlockLinesWithNumbering),children:r.map(function(e,t){return(0,l.jsx)(eo,{line:e,getLineProps:o,getTokenProps:s,classNames:K[t],showLineNumbers:er},t)})})})}}),(0,l.jsxs)("div",{className:X.buttonGroup,children:[(W.isEnabled||W.isCodeScrollable)&&(0,l.jsx)(eb,{className:X.codeButton,onClick:function(){return W.toggle()},isEnabled:W.isEnabled}),(0,l.jsx)(eu,{className:X.codeButton,code:en})]})]})]})}function eg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,s;r=e,o=t,s=n[t],o in r?Object.defineProperty(r,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[o]=s})}return e}let ef=(s=function(e){var t,n,r,o=e.children,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++){if(n=s[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(e,["children"]),c=(0,u.Z)();var a=(t=o,i.Children.toArray(t).some(function(e){return(0,i.isValidElement)(e)})?t:Array.isArray(t)?t.join(""):t),d="string"==typeof a?ep:Q;return(0,l.jsx)(d,(n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,s;r=e,o=t,s=n[t],o in r?Object.defineProperty(r,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[o]=s})}return e}({},s),r=(r={children:a},r),Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n),String(c))},function(e){return e.live?(0,l.jsx)(L,eg({scope:I},e)):(0,l.jsx)(s,eg({},e))});function em(e){return(0,l.jsx)(ef,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,s;r=e,o=t,s=n[t],o in r?Object.defineProperty(r,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[o]=s})}return e}({},e))}}}]); |