docusaurus/assets/js/7fdd8ddf.bb9b5110.js
2024-09-11 15:19:51 +00:00

5 lines
No EOL
46 KiB
JavaScript

"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[63054],{15995:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(62540);n(63696);var s=n(11750);function o({children:e,hidden:t,className:n}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,s.A)("tabItem_pnkT",n),hidden:t,children:e})}},27446:(e,t,n)=>{n.d(t,{A:()=>x});var r=n(62540),s=n(63696),o=n(11750),l=n(7846),c=n(49519),i=n(96439),a=n(19739),d=n(66904),u=n(79244);function h(e){var t,n;return null!==(n=null===(t=s.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,s.isValidElement)(e)&&function(e){let{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(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.`)}))||void 0===t?void 0:t.filter(Boolean))&&void 0!==n?n:[]}function p({value:e,tabValues:t}){return t.some(t=>t.value===e)}var b=n(10709);function g(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;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function j(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 m({className:e,block:t,selectedValue:n,selectValue:s,tabValues:c}){let i=[],{blockElementScrollPositionUntilNextRender:a}=(0,l.a_)(),d=e=>{let t=e.currentTarget,r=c[i.indexOf(t)].value;r!==n&&(a(t),s(r))},u=e=>{var t,n;let r=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{let n=i.indexOf(e.currentTarget)+1;r=null!==(t=i[n])&&void 0!==t?t:i[0];break}case"ArrowLeft":{let t=i.indexOf(e.currentTarget)-1;r=null!==(n=i[t])&&void 0!==n?n:i[i.length-1]}}null==r||r.focus()};return(0,r.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":t},e),children:c.map(({value:e,label:t,attributes:s})=>(0,r.jsx)("li",j(g({role:"tab",tabIndex:n===e?0:-1,"aria-selected":n===e,ref:e=>i.push(e),onKeyDown:u,onClick:d},s),{className:(0,o.A)("tabs__item","tabItem_AQgk",null==s?void 0:s.className,{"tabs__item--active":n===e}),children:null!=t?t:e}),e))})}function f({lazy:e,children:t,selectedValue:n}){let l=(Array.isArray(t)?t:[t]).filter(Boolean);if(e){let e=l.find(e=>e.props.value===n);return e?(0,s.cloneElement)(e,{className:(0,o.A)("margin-top--md",e.props.className)}):null}return(0,r.jsx)("div",{className:"margin-top--md",children:l.map((e,t)=>(0,s.cloneElement)(e,{key:t,hidden:e.props.value!==n}))})}function y(e){let t=function(e){let{defaultValue:t,queryString:n=!1,groupId:r}=e,o=function(e){let{values:t,children:n}=e;return(0,s.useMemo)(()=>{let e=null!=t?t:h(n).map(({props:{value:e,label:t,attributes:n,default:r}})=>({value:e,label:t,attributes:n,default:r}));return!function(e){let t=(0,d.XI)(e,(e,t)=>e.value===t.value);if(t.length>0)throw Error(`Docusaurus error: Duplicate values "${t.map(e=>e.value).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e},[t,n])}(e),[l,b]=(0,s.useState)(()=>(function({defaultValue:e,tabValues:t}){var n;if(0===t.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(e){if(!p({value:e,tabValues:t}))throw Error(`Docusaurus error: The <Tabs> has a defaultValue "${e}" 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 e}let r=null!==(n=t.find(e=>e.default))&&void 0!==n?n:t[0];if(!r)throw Error("Unexpected error: 0 tabValues");return r.value})({defaultValue:t,tabValues:o})),[g,j]=function({queryString:e=!1,groupId:t}){let n=(0,c.W6)(),r=function({queryString:e=!1,groupId:t}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!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 null!=t?t:null}({queryString:e,groupId:t});return[(0,a.aZ)(r),(0,s.useCallback)(e=>{var t,s;if(!r)return;let o=new URLSearchParams(n.location.search);o.set(r,e),n.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;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},n.location),s=s={search:o.toString()},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(s)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(s,e))}),t))},[r,n])]}({queryString:n,groupId:r}),[m,f]=function({groupId:e}){let t=e?`docusaurus.tab.${e}`:null,[n,r]=(0,u.Dv)(t);return[n,(0,s.useCallback)(e=>{t&&r.set(e)},[t,r])]}({groupId:r}),y=(()=>{let e=null!=g?g:m;return p({value:e,tabValues:o})?e:null})();return(0,i.A)(()=>{y&&b(y)},[y]),{selectedValue:l,selectValue:(0,s.useCallback)(e=>{if(!p({value:e,tabValues:o}))throw Error(`Can't select invalid tab value=${e}`);b(e),j(e),f(e)},[j,f,o]),tabValues:o}}(e);return(0,r.jsxs)("div",{className:(0,o.A)("tabs-container","tabList_Qoir"),children:[(0,r.jsx)(m,g({},t,e)),(0,r.jsx)(f,g({},t,e))]})}function x(e){let t=(0,b.A)();return(0,r.jsx)(y,j(g({},e),{children:h(e.children)}),String(t))}},40576:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(62540);n(63696);var s=n(10709);function o({children:e,fallback:t}){return(0,s.A)()?(0,r.jsx)(r.Fragment,{children:null==e?void 0:e()}):null!=t?t:null}},70361:(e,t,n)=>{n.d(t,{A:()=>c});var r=n(62540);n(63696);var s=n(11750);let o="dot_giz1",l="bar_rrRL";function c({children:e,minHeight:t,url:n="http://localhost:3000",style:c,bodyStyle:i}){var a,d;return(0,r.jsxs)("div",{className:"browserWindow_my1Q",style:(a=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;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},c),d=d={minHeight:t},Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(d)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(d)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(d,e))}),a),children:[(0,r.jsxs)("div",{className:"browserWindowHeader_jXSR",children:[(0,r.jsxs)("div",{className:"buttons_uHc7",children:[(0,r.jsx)("span",{className:o,style:{background:"#f25f58"}}),(0,r.jsx)("span",{className:o,style:{background:"#fbbe3c"}}),(0,r.jsx)("span",{className:o,style:{background:"#58cb42"}})]}),(0,r.jsx)("div",{className:(0,s.A)("browserWindowAddressBar_Pd8y","text--truncate"),children:n}),(0,r.jsx)("div",{className:"browserWindowMenuIcon_Vhuh",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:l}),(0,r.jsx)("span",{className:l}),(0,r.jsx)("span",{className:l})]})})]}),(0,r.jsx)("div",{className:"browserWindowBody_Idgs",style:i,children:e})]})}},55887:(e,t,n)=>{n.d(t,{A:()=>ec});var r,s,o,l={};n.r(l),n.d(l,{ButtonExample:()=>_});var c=n(62540),i=n(63696),a=n(11750),d=n(10709),u=n(55152),h=n(81912),p=n(99468),b=n(40576),g=n(1495),j=n(66659),m=n(25436);function f(){let{prism:e}=(0,m.p)(),{colorMode:t}=(0,j.G)(),n=e.theme,r=e.darkTheme||n;return"dark"===t?r:n}var y=n(43758);function x(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;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function O({children:e}){return(0,c.jsx)("div",{className:(0,a.A)("playgroundHeader_Tvsk"),children:e})}function v(){return(0,c.jsx)("div",{children:"Loading..."})}function w(){return(0,c.jsx)(b.A,{fallback:(0,c.jsx)(v,{}),children:()=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(y.A,{fallback:e=>(0,c.jsx)(g.MN,x({},e)),children:(0,c.jsx)(u.pA,{})}),(0,c.jsx)(u.p1,{})]})})}function T(){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(O,{children:(0,c.jsx)(h.A,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,c.jsx)("div",{className:"playgroundPreview_mApW",children:(0,c.jsx)(w,{})})]})}function k(){let e=(0,d.A)();return(0,c.jsx)(u.w,{className:"playgroundEditor_TySg"},String(e))}function P(){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(O,{children:(0,c.jsx)(h.A,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,c.jsx)(k,{})]})}let S=e=>`${e};`;function N(e){var t,n,r,s,{children:o,transformCode:l}=e,i=function(e,t){if(null==e)return{};var n,r,s=function(e,t){if(null==e)return{};var n,r,s={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(s[n]=e[n]);return s}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}(e,["children","transformCode"]);let{siteConfig:{themeConfig:a}}=(0,p.A)(),{liveCodeBlock:{playgroundPosition:d}}=a,h=f(),b=null!==(s=null===(r=i.metastring)||void 0===r?void 0:r.includes("noInline"))&&void 0!==s&&s;return(0,c.jsx)("div",{className:"playgroundContainer_6Ior",children:(0,c.jsx)(u.Q,(t=x({code:null==o?void 0:o.replace(/\n$/,""),noInline:b,transformCode:null!=l?l:S,theme:h},i),n=n={children:"top"===d?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(T,{}),(0,c.jsx)(P,{})]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(P,{}),(0,c.jsx)(T,{})]})},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 E(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;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function _(e){var t,n;return(0,c.jsx)("button",(t=E({type:"button"},e),n=n={style:E({backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer"},e.style)},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 A=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;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({React:i},i,l);var B=n(12653),D=n(19934),C=n.n(D);let L=RegExp("title=(?<quote>[\"'])(?<title>.*?)\\1"),I=RegExp("\\{(?<range>[\\d,-]+)\\}"),$={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"<!--",end:"-->"}},R=(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;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},$),s=s={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.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(s)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(s)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(s,e))}),r),H=Object.keys($);function M(e,t){let n=e.map(e=>{let{start:n,end:r}=R[e];return`(?:${n}\\s*(${t.flatMap(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*${r})`}).join("|");return RegExp(`^\\s*(?:${n})\\s*$`)}function F(e){var t,n,{as:r}=e,s=function(e,t){if(null==e)return{};var n,r,s=function(e,t){if(null==e)return{};var n,r,s={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(s[n]=e[n]);return s}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}(e,["as"]);let o=function(e){let t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={};return Object.entries(e.plain).forEach(([e,r])=>{let s=t[e];s&&"string"==typeof r&&(n[s]=r)}),n}(f());return(0,c.jsx)(r,(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;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},s),n=n={style:o,className:(0,a.A)(s.className,"codeBlockContainer_jDV4",B.G.common.codeBlock)},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 W={codeBlockContent:"codeBlockContent_vx7S",codeBlockTitle:"codeBlockTitle_bdru",codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q",buttonGroup:"buttonGroup_cUGO"};function q({children:e,className:t}){return(0,c.jsx)(F,{as:"pre",tabIndex:0,className:(0,a.A)(W.codeBlockStandalone,"thin-scrollbar",t),children:(0,c.jsx)("code",{className:W.codeBlockLines,children:e})})}var V=n(2550);let z={attributes:!0,characterData:!0,childList:!0,subtree:!0};var G=n(27663);let U={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function Q(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;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function X({line:e,classNames:t,showLineNumbers:n,getLineProps:r,getTokenProps:s}){var o,l;1===e.length&&"\n"===e[0].content&&(e[0].content="");let i=r({line:e,className:(0,a.A)(t,n&&U.codeLine)}),d=e.map((e,t)=>(0,c.jsx)("span",Q({},s({token:e})),t));return(0,c.jsxs)("span",(o=Q({},i),l=l={children:[n?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:U.codeLineNumber}),(0,c.jsx)("span",{className:U.codeLineContent,children:d})]}):d,(0,c.jsx)("br",{})]},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(l)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(l)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(l,e))}),o))}var J=n(936);function Y(e){var t,n;return(0,c.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;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({viewBox:"0 0 24 24"},e),n=n={children:(0,c.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"})},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 Z(e){var t,n;return(0,c.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;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({viewBox:"0 0 24 24"},e),n=n={children:(0,c.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})},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 K={copyButtonCopied:"copyButtonCopied_OkN_",copyButtonIcons:"copyButtonIcons_OqsO",copyButtonIcon:"copyButtonIcon_PgCn",copyButtonSuccessIcon:"copyButtonSuccessIcon_bsQG"};function ee({code:e,className:t}){let[n,r]=(0,i.useState)(!1),s=(0,i.useRef)(void 0),o=(0,i.useCallback)(()=>{(0,J.A)(e),r(!0),s.current=window.setTimeout(()=>{r(!1)},1e3)},[e]);return(0,i.useEffect)(()=>()=>window.clearTimeout(s.current),[]),(0,c.jsx)("button",{type:"button","aria-label":n?(0,h.T)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,h.T)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,h.T)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,a.A)("clean-btn",t,K.copyButton,n&&K.copyButtonCopied),onClick:o,children:(0,c.jsxs)("span",{className:K.copyButtonIcons,"aria-hidden":"true",children:[(0,c.jsx)(Y,{className:K.copyButtonIcon}),(0,c.jsx)(Z,{className:K.copyButtonSuccessIcon})]})})}function et(e){var t,n;return(0,c.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;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({viewBox:"0 0 24 24"},e),n=n={children:(0,c.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"})},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 en={wordWrapButtonIcon:"wordWrapButtonIcon_MQXS",wordWrapButtonEnabled:"wordWrapButtonEnabled_TBIH"};function er({className:e,onClick:t,isEnabled:n}){let r=(0,h.T)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,c.jsx)("button",{type:"button",onClick:t,className:(0,a.A)("clean-btn",e,n&&en.wordWrapButtonEnabled),"aria-label":r,title:r,children:(0,c.jsx)(et,{className:en.wordWrapButtonIcon,"aria-hidden":"true"})})}function es({children:e,className:t="",metastring:n,title:r,showLineNumbers:s,language:o}){var l,d,u,h;let{prism:{defaultLanguage:p,magicComments:b}}=(0,m.p)(),g=null==(d=null!==(l=null!=o?o:function(e){let t=e.split(" ").find(e=>e.startsWith("language-"));return null==t?void 0:t.replace(/language-/,"")}(t))&&void 0!==l?l:p)?void 0:d.toLowerCase(),j=f(),y=function(){let[e,t]=(0,i.useState)(!1),[n,r]=(0,i.useState)(!1),s=(0,i.useRef)(null),o=(0,i.useCallback)(()=>{let n=s.current.querySelector("code");e?n.removeAttribute("style"):(n.style.whiteSpace="pre-wrap",n.style.overflowWrap="anywhere"),t(e=>!e)},[s,e]),l=(0,i.useCallback)(()=>{let{scrollWidth:e,clientWidth:t}=s.current;r(e>t||s.current.querySelector("code").hasAttribute("style"))},[s]);return!function(e,t){let[n,r]=(0,i.useState)(),s=(0,i.useCallback)(()=>{var t;r(null===(t=e.current)||void 0===t?void 0:t.closest("[role=tabpanel][hidden]"))},[e,r]);(0,i.useEffect)(()=>{s()},[s]),function(e,t,n=z){let r=(0,V._q)(t),s=(0,V.Be)(n);(0,i.useEffect)(()=>{let t=new MutationObserver(r);return e&&t.observe(e,s),()=>t.disconnect()},[e,r,s])}(n,e=>{e.forEach(e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(t(),s())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1})}(s,l),(0,i.useEffect)(()=>{l()},[e,l]),(0,i.useEffect)(()=>(window.addEventListener("resize",l,{passive:!0}),()=>{window.removeEventListener("resize",l)}),[l]),{codeBlockRef:s,isEnabled:e,isCodeScrollable:n,toggle:o}}(),x=(null!==(h=null==n?void 0:null===(u=n.match(L))||void 0===u?void 0:u.groups.title)&&void 0!==h?h:"")||r,{lineClassNames:O,code:v}=function(e,t){let n=e.replace(/\n$/,""),{language:r,magicComments:s,metastring:o}=t;if(o&&I.test(o)){let e=o.match(I).groups.range;if(0===s.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 t=s[0].className;return{lineClassNames:Object.fromEntries(C()(e).filter(e=>e>0).map(e=>[e-1,[t]])),code:n}}if(void 0===r)return{lineClassNames:{},code:n};let l=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return M(["js","jsBlock"],t);case"jsx":case"tsx":return M(["js","jsBlock","jsx"],t);case"html":return M(["js","jsBlock","html"],t);case"python":case"py":case"bash":return M(["bash"],t);case"markdown":case"md":return M(["html","jsx","bash"],t);case"tex":case"latex":case"matlab":return M(["tex"],t);case"lua":case"haskell":case"sql":return M(["lua"],t);case"wasm":return M(["wasm"],t);case"vb":case"vba":case"visual-basic":return M(["vb","rem"],t);case"vbnet":return M(["vbnet","rem"],t);case"batch":return M(["rem"],t);case"basic":return M(["rem","f90"],t);case"fsharp":return M(["js","ml"],t);case"ocaml":case"sml":return M(["ml"],t);case"fortran":return M(["f90"],t);case"cobol":return M(["cobol"],t);default:return M(H,t)}}(r,s),c=n.split("\n"),i=Object.fromEntries(s.map(e=>[e.className,{start:0,range:""}])),a=Object.fromEntries(s.filter(e=>e.line).map(({className:e,line:t})=>[t,e])),d=Object.fromEntries(s.filter(e=>e.block).map(({className:e,block:t})=>[t.start,e])),u=Object.fromEntries(s.filter(e=>e.block).map(({className:e,block:t})=>[t.end,e]));for(let e=0;e<c.length;){let t=c[e].match(l);if(!t){e+=1;continue}let n=t.slice(1).find(e=>void 0!==e);a[n]?i[a[n]].range+=`${e},`:d[n]?i[d[n]].start=e:u[n]&&(i[u[n]].range+=`${i[u[n]].start}-${e-1},`),c.splice(e,1)}n=c.join("\n");let h={};return Object.entries(i).forEach(([e,{range:t}])=>{C()(t).forEach(t=>{var n;null!==(n=h[t])&&void 0!==n||(h[t]=[]),h[t].push(e)})}),{lineClassNames:h,code:n}}(e,{metastring:n,language:g,magicComments:b}),w=null!=s?s:!!(null==n?void 0:n.includes("showLineNumbers"));return(0,c.jsxs)(F,{as:"div",className:(0,a.A)(t,g&&!t.includes(`language-${g}`)&&`language-${g}`),children:[x&&(0,c.jsx)("div",{className:W.codeBlockTitle,children:x}),(0,c.jsxs)("div",{className:W.codeBlockContent,children:[(0,c.jsx)(G.f4,{theme:j,code:v,language:null!=g?g:"text",children:({className:e,style:t,tokens:n,getLineProps:r,getTokenProps:s})=>(0,c.jsx)("pre",{tabIndex:0,ref:y.codeBlockRef,className:(0,a.A)(e,W.codeBlock,"thin-scrollbar"),style:t,children:(0,c.jsx)("code",{className:(0,a.A)(W.codeBlockLines,w&&W.codeBlockLinesWithNumbering),children:n.map((e,t)=>(0,c.jsx)(X,{line:e,getLineProps:r,getTokenProps:s,classNames:O[t],showLineNumbers:w},t))})})}),(0,c.jsxs)("div",{className:W.buttonGroup,children:[(y.isEnabled||y.isCodeScrollable)&&(0,c.jsx)(er,{className:W.codeButton,onClick:()=>y.toggle(),isEnabled:y.isEnabled}),(0,c.jsx)(ee,{className:W.codeButton,code:v})]})]})]})}function eo(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;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}let el=(o=function(e){var t,n,{children:r}=e,s=function(e,t){if(null==e)return{};var n,r,s=function(e,t){if(null==e)return{};var n,r,s={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(s[n]=e[n]);return s}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}(e,["children"]);let o=(0,d.A)(),l=i.Children.toArray(r).some(e=>(0,i.isValidElement)(e))?r:Array.isArray(r)?r.join(""):r,a="string"==typeof l?es:q;return(0,c.jsx)(a,(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;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},s),n=n={children:l},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),String(o))},function(e){return e.live?(0,c.jsx)(N,eo({scope:A},e)):(0,c.jsx)(o,eo({},e))});function ec(e){return(0,c.jsx)(el,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;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e))}},43091:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>h,contentTitle:()=>u,default:()=>g,frontMatter:()=>d,metadata:()=>r,toc:()=>p});let 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":"dependabot[bot]","lastUpdatedAt":1726067792000,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/_dogfooding/_pages tests/code-block-tests.mdx","unlisted":false}');var s=n(62540),o=n(43023),l=n(55887),c=n(70361),i=n(27446),a=n(15995);let d={},u="Code block tests",h={},p=[{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 &gt; string</code>",id:"pre--string",level:3},{value:"<code>pre &gt; string[]</code>",id:"pre--string-1",level:3},{value:"<code>pre &gt; element</code>",id:"pre--element",level:3},{value:"<code>pre &gt; element[]</code>",id:"pre--element-1",level:3},{value:"<code>pre &gt; code &gt; element</code>",id:"pre--code--element",level:3},{value:"<code>code</code>",id:"code",level:2},{value:"<code>code &gt; string</code>",id:"code--string",level:3},{value:"<code>code &gt; string[]</code>",id:"code--string-1",level:3},{value:"<code>code &gt; element</code>",id:"code--element",level:3},{value:"<code>code &gt; element[]</code>",id:"code--element-1",level:3},{value:"<code>CodeBlock</code>",id:"codeblock",level:2},{value:"<code>CodeBlock &gt; string</code>",id:"codeblock--string",level:3},{value:"<code>CodeBlock &gt; string[]</code>",id:"codeblock--string-1",level:3},{value:"<code>CodeBlock &gt; element</code>",id:"codeblock--element",level:3},{value:"<code>CodeBlock &gt; 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 b(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,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.header,{children:(0,s.jsx)(t.h1,{id:"code-block-tests",children:"Code block tests"})}),"\n",(0,s.jsx)(t.admonition,{title:"legacy test page - MDX v1",type:"danger",children:(0,s.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,s.jsx)(t.hr,{}),"\n",(0,s.jsx)(t.pre,{children:(0,s.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,s.jsx)(t.p,{children:"See:"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.a,{href:"https://github.com/facebook/docusaurus/pull/1584",children:"https://github.com/facebook/docusaurus/pull/1584"})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.a,{href:"https://github.com/facebook/docusaurus/pull/3749",children:"https://github.com/facebook/docusaurus/pull/3749"})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.a,{href:"https://github.com/facebook/docusaurus/pull/6177",children:"https://github.com/facebook/docusaurus/pull/6177"})}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"code-block-prism-language-tests",children:"Code block prism language tests"}),"\n",(0,s.jsxs)(t.p,{children:["Code block with/without the good prism language case(lower or upper) in ",(0,s.jsx)(t.code,{children:"additionalLanguages[]"})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.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,s.jsx)(t.pre,{children:(0,s.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,s.jsx)(t.pre,{children:(0,s.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,s.jsx)(t.p,{children:"See:"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.a,{href:"https://github.com/facebook/docusaurus/pull/9183",children:"https://github.com/facebook/docusaurus/pull/9183"})}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"pre",children:(0,s.jsx)(t.code,{children:"pre"})}),"\n",(0,s.jsx)(t.h3,{id:"pre--string",children:(0,s.jsx)(t.code,{children:"pre > string"})}),"\n",(0,s.jsxs)(t.p,{children:["Multi-line text inside ",(0,s.jsx)(t.code,{children:"pre"})," will turn into one-liner, but it's okay (",(0,s.jsx)(t.a,{href:"https://github.com/mdx-js/mdx/issues/1095",children:"https://github.com/mdx-js/mdx/issues/1095"}),")"]}),"\n",(0,s.jsx)("pre",{children:"1 2 3"}),"\n","\n",(0,s.jsx)("pre",{children:(0,s.jsx)(t.p,{children:"1\n2\n3"})}),"\n",(0,s.jsx)(t.h3,{id:"pre--string-1",children:(0,s.jsx)(t.code,{children:"pre > string[]"})}),"\n",(0,s.jsx)("pre",{children:(0,s.jsxs)(t.p,{children:["1","\n","2","\n","3","\n"]})}),"\n",(0,s.jsx)(t.h3,{id:"pre--element",children:(0,s.jsx)(t.code,{children:"pre > element"})}),"\n",(0,s.jsx)("pre",{children:(0,s.jsx)(c.A,{children:"Lol bro"})}),"\n",(0,s.jsx)(t.h3,{id:"pre--element-1",children:(0,s.jsx)(t.code,{children:"pre > element[]"})}),"\n",(0,s.jsxs)("pre",{children:[(0,s.jsx)("a",{href:"/",children:"Front page"}),"\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)("strong",{children:"Input: "}),'a = "abcd", b = "cdabcdab"',"\n","\n",(0,s.jsx)("strong",{children:"Output: "}),"3","\n","\n",(0,s.jsx)("strong",{children:"Explanation: "}),'a after three repetitions become "ab\n',(0,s.jsx)("strong",{children:"cdabcdab"}),'cd", at which time b is a substring.',"\n"]})]}),"\n",(0,s.jsx)(t.h3,{id:"pre--code--element",children:(0,s.jsx)(t.code,{children:"pre > code > element"})}),"\n",(0,s.jsx)("pre",{children:(0,s.jsx)("code",{children:(0,s.jsx)("b",{children:"Hey bro"})})}),"\n",(0,s.jsx)(t.h2,{id:"code",children:(0,s.jsx)(t.code,{children:"code"})}),"\n",(0,s.jsx)(t.h3,{id:"code--string",children:(0,s.jsx)(t.code,{children:"code > string"})}),"\n",(0,s.jsx)("code",{children:"1 2 3"}),"\n",(0,s.jsx)("code",{children:`link:
title: front page
path: /docs/`}),"\n",(0,s.jsx)(t.h3,{id:"code--string-1",children:(0,s.jsx)(t.code,{children:"code > string[]"})}),"\n",(0,s.jsx)("code",{children:(0,s.jsxs)(t.p,{children:["link:"," \n","\n"," ","title: front page","\n","\n"," ","path: /docs/","\n"]})}),"\n",(0,s.jsx)(t.h3,{id:"code--element",children:(0,s.jsx)(t.code,{children:"code > element"})}),"\n",(0,s.jsx)("code",{children:(0,s.jsx)(c.A,{children:"Lol bro"})}),"\n",(0,s.jsx)(t.h3,{id:"code--element-1",children:(0,s.jsx)(t.code,{children:"code > element[]"})}),"\n",(0,s.jsxs)("code",{children:[(0,s.jsx)("a",{href:"/",children:"Front page"}),(0,s.jsx)("br",{}),(0,s.jsxs)(t.p,{children:[(0,s.jsx)("strong",{children:"Input: "}),'a = "abcd", b = "cdabcdab"']}),(0,s.jsx)("br",{}),(0,s.jsxs)(t.p,{children:[(0,s.jsx)("strong",{children:"Output: "}),"3",(0,s.jsx)("br",{}),"\n",(0,s.jsx)("strong",{children:"Explanation: "}),'a after three repetitions become "ab',(0,s.jsx)("strong",{children:"\ncdabcdab\n"}),'cd", at which time b is a substring.']}),(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(t.h2,{id:"codeblock",children:(0,s.jsx)(t.code,{children:"CodeBlock"})}),"\n",(0,s.jsx)(t.h3,{id:"codeblock--string",children:(0,s.jsx)(t.code,{children:"CodeBlock > string"})}),"\n",(0,s.jsx)(l.A,{children:"1 2 3"}),"\n",(0,s.jsx)(l.A,{className:"language-yaml",title:"test",children:`link:
title: front page
path: /docs/`}),"\n",(0,s.jsx)(t.h3,{id:"codeblock--string-1",children:(0,s.jsx)(t.code,{children:"CodeBlock > string[]"})}),"\n",(0,s.jsx)(l.A,{className:"language-yaml",title:"test",children:(0,s.jsxs)(t.p,{children:["link:","\n","\n"," ","title: front page","\n","\n"," ","path: /docs/","\n"]})}),"\n",(0,s.jsx)(t.h3,{id:"codeblock--element",children:(0,s.jsx)(t.code,{children:"CodeBlock > element"})}),"\n",(0,s.jsx)(l.A,{className:"language-yaml",title:"test",children:(0,s.jsx)(c.A,{children:"Lol bro"})}),"\n",(0,s.jsx)(t.h3,{id:"codeblock--element-1",children:(0,s.jsx)(t.code,{children:"CodeBlock > element[]"})}),"\n",(0,s.jsxs)(l.A,{className:"language-yaml",title:"test",children:[(0,s.jsx)("a",{href:"/",children:"Front page"}),(0,s.jsx)("br",{}),(0,s.jsxs)(t.p,{children:[(0,s.jsx)("strong",{children:"Input: "}),'a = "abcd", b = "cdabcdab"']}),(0,s.jsx)("br",{}),(0,s.jsxs)(t.p,{children:[(0,s.jsx)("strong",{children:"Output: "}),"3",(0,s.jsx)("br",{}),"\n",(0,s.jsx)("strong",{children:"Explanation: "}),'a after three repetitions become "ab',(0,s.jsx)("strong",{children:"\ncdabcdab\n"}),'cd", at which time b is a substring.']}),(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(t.h2,{id:"code-blocks-with-line-numbering-tests",children:"Code blocks with line numbering tests"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.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,s.jsx)(t.pre,{children:(0,s.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,s.jsx)(t.pre,{children:(0,s.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,s.jsx)(t.h2,{id:"code-block-wrapping-tests",children:"Code block wrapping tests"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.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,s.jsxs)(i.A,{children:[(0,s.jsx)(a.A,{value:"short-tab-1",label:"Short tab",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:'echo "hi"\n'})})}),(0,s.jsx)(a.A,{value:"long-tab",label:"Long tab",children:(0,s.jsx)(t.pre,{children:(0,s.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,s.jsx)(a.A,{value:"short-tab-2",label:"Short tab",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"rm short_initially_hidden_string\n"})})})]}),"\n",(0,s.jsxs)(i.A,{children:[(0,s.jsx)(a.A,{value:"long-tab",label:"Long tab",children:(0,s.jsx)(t.pre,{children:(0,s.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,s.jsx)(a.A,{value:"short-tab",label:"Short tab",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:'echo "short_initially_hidden_string"\n'})})})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.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,s.jsx)(t.h2,{id:"magic-comments-tests",children:"Magic comments tests"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.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,s.jsx)(t.pre,{children:(0,s.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,s.jsx)(t.pre,{children:(0,s.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,s.jsx)(t.pre,{children:(0,s.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,s.jsx)(t.pre,{children:(0,s.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,s.jsx)(t.pre,{children:(0,s.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,s.jsx)(t.pre,{children:(0,s.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,s.jsx)(t.pre,{children:(0,s.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,s.jsx)(t.pre,{children:(0,s.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,s.jsx)(t.pre,{children:(0,s.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,s.jsx)(t.pre,{children:(0,s.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,s.jsx)(t.pre,{children:(0,s.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,s.jsx)(t.h2,{id:"html---script--style-highlighting",children:"HTML - script + style highlighting"}),"\n",(0,s.jsxs)(t.p,{children:["See ",(0,s.jsx)(t.a,{href:"https://github.com/facebook/docusaurus/issues/9517",children:"https://github.com/facebook/docusaurus/issues/9517"})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.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,s.jsx)(t.h2,{id:"empty-code-blocks-edge-cases",children:"Empty code blocks edge cases"}),"\n",(0,s.jsx)(t.p,{children:"Empty inline code block: ``"}),"\n",(0,s.jsxs)(t.p,{children:["Single space inline code block: ",(0,s.jsx)(t.code,{children:" "})]}),"\n",(0,s.jsx)(t.p,{children:"Empty code block"}),"\n","\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{})}),"\n",(0,s.jsx)(t.p,{children:"Empty 1 line code block"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{})}),"\n",(0,s.jsx)(t.p,{children:"Empty 2 line code block"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{})}),"\n",(0,s.jsx)(t.p,{children:"Empty live code block"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",metastring:"live",live:!0})})]})}function g(e={}){let{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(b,{...e})}):b(e)}}}]);