blob: d05f86bcaa35f80f1c1d2717e09ce34b3d862b93 [file] [log] [blame]
(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4783],{3522:function(e,t,n){"use strict";n.d(t,{Z:function(){return N}});var o=n(7462),r=n(7294),a=n(6010),l={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},c={Prism:n(7410).Z,theme:l};function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},i.apply(this,arguments)}var p=/\r\n|\r|\n/,u=function(e){0===e.length?e.push({types:["plain"],content:"\n",empty:!0}):1===e.length&&""===e[0].content&&(e[0].content="\n",e[0].empty=!0)},d=function(e,t){var n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)};function y(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&-1===t.indexOf(o)&&(n[o]=e[o]);return n}var h=function(e){function t(){for(var t=this,n=[],o=arguments.length;o--;)n[o]=arguments[o];e.apply(this,n),s(this,"getThemeDict",(function(e){if(void 0!==t.themeDict&&e.theme===t.prevTheme&&e.language===t.prevLanguage)return t.themeDict;t.prevTheme=e.theme,t.prevLanguage=e.language;var n=e.theme?function(e,t){var n=e.plain,o=Object.create(null),r=e.styles.reduce((function(e,n){var o=n.languages,r=n.style;return o&&!o.includes(t)||n.types.forEach((function(t){var n=i({},e[t],r);e[t]=n})),e}),o);return r.root=n,r.plain=i({},n,{backgroundColor:null}),r}(e.theme,e.language):void 0;return t.themeDict=n})),s(this,"getLineProps",(function(e){var n=e.key,o=e.className,r=e.style,a=i({},y(e,["key","className","style","line"]),{className:"token-line",style:void 0,key:void 0}),l=t.getThemeDict(t.props);return void 0!==l&&(a.style=l.plain),void 0!==r&&(a.style=void 0!==a.style?i({},a.style,r):r),void 0!==n&&(a.key=n),o&&(a.className+=" "+o),a})),s(this,"getStyleForToken",(function(e){var n=e.types,o=e.empty,r=n.length,a=t.getThemeDict(t.props);if(void 0!==a){if(1===r&&"plain"===n[0])return o?{display:"inline-block"}:void 0;if(1===r&&!o)return a[n[0]];var l=o?{display:"inline-block"}:{},c=n.map((function(e){return a[e]}));return Object.assign.apply(Object,[l].concat(c))}})),s(this,"getTokenProps",(function(e){var n=e.key,o=e.className,r=e.style,a=e.token,l=i({},y(e,["key","className","style","token"]),{className:"token "+a.types.join(" "),children:a.content,style:t.getStyleForToken(a),key:void 0});return void 0!==r&&(l.style=void 0!==l.style?i({},l.style,r):r),void 0!==n&&(l.key=n),o&&(l.className+=" "+o),l})),s(this,"tokenize",(function(e,t,n,o){var r={code:t,grammar:n,language:o,tokens:[]};e.hooks.run("before-tokenize",r);var a=r.tokens=e.tokenize(r.code,r.grammar,r.language);return e.hooks.run("after-tokenize",r),a}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.render=function(){var e=this.props,t=e.Prism,n=e.language,o=e.code,r=e.children,a=this.getThemeDict(this.props),l=t.languages[n];return r({tokens:function(e){for(var t=[[]],n=[e],o=[0],r=[e.length],a=0,l=0,c=[],s=[c];l>-1;){for(;(a=o[l]++)<r[l];){var i=void 0,y=t[l],h=n[l][a];if("string"==typeof h?(y=l>0?y:["plain"],i=h):(y=d(y,h.type),h.alias&&(y=d(y,h.alias)),i=h.content),"string"==typeof i){var g=i.split(p),m=g.length;c.push({types:y,content:g[0]});for(var f=1;f<m;f++)u(c),s.push(c=[]),c.push({types:y,content:g[f]})}else l++,t.push(y),n.push(i),o.push(0),r.push(i.length)}l--,t.pop(),n.pop(),o.pop(),r.pop()}return u(c),s}(void 0!==l?this.tokenize(t,o,l,n):[o]),className:"prism-code language-"+n,style:void 0!==a?a.root:{},getLineProps:this.getLineProps,getTokenProps:this.getTokenProps})},t}(r.Component),g=h;var m=n(7594),f=n.n(m),v={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},k=n(8002),b=n(4395),B=function(){var e=(0,b.LU)().prism,t=(0,k.Z)().isDarkTheme,n=e.theme||v,o=e.darkTheme||n;return t?o:n},j=n(7130),T={codeBlockContainer:"codeBlockContainer_J+bg",codeBlockContent:"codeBlockContent_csEI",codeBlockTitle:"codeBlockTitle_oQzk",codeBlock:"codeBlock_rtdJ",codeBlockWithTitle:"codeBlockWithTitle_ZT05",copyButton:"copyButton_M3SB",codeBlockLines:"codeBlockLines_1zSZ"},E=/{([\d,-]+)}/,C=function(e){void 0===e&&(e=["js","jsBlock","jsx","python","html"]);var t={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},python:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},n=["highlight-next-line","highlight-start","highlight-end"].join("|"),o=e.map((function(e){return"(?:"+t[e].start+"\\s*("+n+")\\s*"+t[e].end+")"})).join("|");return new RegExp("^\\s*(?:"+o+")\\s*$")},x=function(e){switch(e){case"js":case"javascript":case"ts":case"typescript":return C(["js","jsBlock"]);case"jsx":case"tsx":return C(["js","jsBlock","jsx"]);case"html":return C(["js","jsBlock","html"]);case"python":case"py":return C(["python"]);default:return C()}};function N(e){var t=e.children,n=e.className,l=e.metastring,s=e.title,i=(0,b.LU)().prism,p=(0,r.useState)(!1),u=p[0],d=p[1],y=(0,r.useState)(!1),h=y[0],m=y[1];(0,r.useEffect)((function(){m(!0)}),[]);var v=(0,b.bc)(l)||s,k=(0,r.useRef)(null),C=[],N=B(),L=Array.isArray(t)?t.join(""):t;if(l&&E.test(l)){var Z=l.match(E)[1];C=f()(Z).filter((function(e){return e>0}))}var w=n&&n.replace(/language-/,"");!w&&i.defaultLanguage&&(w=i.defaultLanguage);var S=L.replace(/\n$/,"");if(0===C.length&&void 0!==w){for(var O,P="",_=x(w),D=L.replace(/\n$/,"").split("\n"),A=0;A<D.length;){var I=A+1,z=D[A].match(_);if(null!==z){switch(z.slice(1).reduce((function(e,t){return e||t}),void 0)){case"highlight-next-line":P+=I+",";break;case"highlight-start":O=I;break;case"highlight-end":P+=O+"-"+(I-1)+","}D.splice(A,1)}else A+=1}C=f()(P),S=D.join("\n")}var R=function(){!function(e,t){var n=(void 0===t?{}:t).target,o=void 0===n?document.body:n;if("string"!=typeof e)throw new TypeError("Expected parameter `text` to be a `string`, got `"+typeof e+"`.");var r=document.createElement("textarea"),a=document.activeElement;r.value=e,r.setAttribute("readonly",""),r.style.contain="strict",r.style.position="absolute",r.style.left="-9999px",r.style.fontSize="12pt";var l=document.getSelection(),c=l.rangeCount>0&&l.getRangeAt(0);o.append(r),r.select(),r.selectionStart=0,r.selectionEnd=e.length;var s=!1;try{s=document.execCommand("copy")}catch(i){}r.remove(),c&&(l.removeAllRanges(),l.addRange(c)),a&&a.focus()}(S),d(!0),setTimeout((function(){return d(!1)}),2e3)};return r.createElement(g,(0,o.Z)({},c,{key:String(h),theme:N,code:S,language:w}),(function(e){var t,n=e.className,l=e.style,c=e.tokens,s=e.getLineProps,i=e.getTokenProps;return r.createElement("div",{className:T.codeBlockContainer},v&&r.createElement("div",{style:l,className:T.codeBlockTitle},v),r.createElement("div",{className:(0,a.Z)(T.codeBlockContent,w)},r.createElement("pre",{tabIndex:0,className:(0,a.Z)(n,T.codeBlock,"thin-scrollbar",(t={},t[T.codeBlockWithTitle]=v,t)),style:l},r.createElement("code",{className:T.codeBlockLines},c.map((function(e,t){1===e.length&&""===e[0].content&&(e[0].content="\n");var n=s({line:e,key:t});return C.includes(t+1)&&(n.className+=" docusaurus-highlight-code-line"),r.createElement("span",(0,o.Z)({key:t},n),e.map((function(e,t){return r.createElement("span",(0,o.Z)({key:t},i({token:e,key:t})))})))})))),r.createElement("button",{ref:k,type:"button","aria-label":(0,j.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),className:(0,a.Z)(T.copyButton,"clean-btn"),onClick:R},u?r.createElement(j.Z,{id:"theme.CodeBlock.copied",description:"The copied button label on code blocks"},"Copied"):r.createElement(j.Z,{id:"theme.CodeBlock.copy",description:"The copy button label on code blocks"},"Copy"))))}))}},4145:function(e,t,n){"use strict";n.d(t,{N:function(){return d},Z:function(){return y}});var o=n(3366),r=n(7462);var a=n(7294),l=n(6010),c=n(7130),s=n(4395),i="enhancedAnchor_WiXH",p="h1Heading_dC7a",u=["id"],d=function(e){var t=Object.assign({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e),e));return a.createElement("header",null,a.createElement("h1",(0,r.Z)({},t,{id:void 0,className:p}),t.children))},y=function(e){return"h1"===e?d:(t=e,function(e){var n,r=e.id,p=(0,o.Z)(e,u),d=(0,s.LU)().navbar.hideOnScroll;return r?a.createElement(t,p,a.createElement("a",{"aria-hidden":"true",tabIndex:-1,className:(0,l.Z)("anchor",(n={},n[i]=!d,n)),id:r}),p.children,a.createElement("a",{className:"hash-link",href:"#"+r,title:(0,c.I)({id:"theme.common.headingLinkTitle",message:"Direct link to heading",description:"Title for link to heading"})},"#")):a.createElement(t,p)});var t}},7594:function(e,t){function n(e){let t,n=[];for(let o of e.split(",").map((e=>e.trim())))if(/^-?\d+$/.test(o))n.push(parseInt(o,10));else if(t=o.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){let[e,o,r,a]=t;if(o&&a){o=parseInt(o),a=parseInt(a);const e=o<a?1:-1;"-"!==r&&".."!==r&&"\u2025"!==r||(a+=e);for(let t=o;t!==a;t+=e)n.push(t)}}return n}t.default=n,e.exports=n}}]);