mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-30 19:59:49 +02:00
1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
(self.webpackChunkOpenSign_Docs=self.webpackChunkOpenSign_Docs||[]).push([[8531],{18152:(e,t,n)=>{"use strict";n.d(t,{Z:()=>S});var o=n(67294),s=n(72389),c=n(36905),r=n(66412),a=n(35281),l=n(37016);const i={codeBlockContainer:"codeBlockContainer_Ckt0"};var u=n(85893);function d(e){let{as:t,...n}=e;const o=(0,r.p)(),s=(0,l.QC)(o);return(0,u.jsx)(t,{...n,style:s,className:(0,c.Z)(n.className,i.codeBlockContainer,a.k.common.codeBlock)})}const m={codeBlockContent:"codeBlockContent_biex",codeBlockTitle:"codeBlockTitle_Ktv7",codeBlock:"codeBlock_bY9V",codeBlockStandalone:"codeBlockStandalone_MEMb",codeBlockLines:"codeBlockLines_e6Vv",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_o6Pm",buttonGroup:"buttonGroup__atx"};function p(e){let{children:t,className:n}=e;return(0,u.jsx)(d,{as:"pre",tabIndex:0,className:(0,c.Z)(m.codeBlockStandalone,"thin-scrollbar",n),children:(0,u.jsx)("code",{className:m.codeBlockLines,children:t})})}var b=n(86668),f=n(85448),h=n(14965);const g={codeLine:"codeLine_lJS_",codeLineNumber:"codeLineNumber_Tfdd",codeLineContent:"codeLineContent_feaV"};function k(e){let{line:t,classNames:n,showLineNumbers:o,getLineProps:s,getTokenProps:r}=e;1===t.length&&"\n"===t[0].content&&(t[0].content="");const a=s({line:t,className:(0,c.Z)(n,o&&g.codeLine)}),l=t.map(((e,t)=>(0,u.jsx)("span",{...r({token:e,key:t})},t)));return(0,u.jsxs)("span",{...a,children:[o?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("span",{className:g.codeLineNumber}),(0,u.jsx)("span",{className:g.codeLineContent,children:l})]}):l,(0,u.jsx)("br",{})]})}var x=n(10195),B=n(95999);function j(e){return(0,u.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,u.jsx)("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})})}function y(e){return(0,u.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,u.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}const C={copyButtonCopied:"copyButtonCopied_obH4",copyButtonIcons:"copyButtonIcons_eSgA",copyButtonIcon:"copyButtonIcon_y97N",copyButtonSuccessIcon:"copyButtonSuccessIcon_LjdS"};function N(e){let{code:t,className:n}=e;const[s,r]=(0,o.useState)(!1),a=(0,o.useRef)(void 0),l=(0,o.useCallback)((()=>{(0,x.Z)(t),r(!0),a.current=window.setTimeout((()=>{r(!1)}),1e3)}),[t]);return(0,o.useEffect)((()=>()=>window.clearTimeout(a.current)),[]),(0,u.jsx)("button",{type:"button","aria-label":s?(0,B.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,B.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,B.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,c.Z)("clean-btn",n,C.copyButton,s&&C.copyButtonCopied),onClick:l,children:(0,u.jsxs)("span",{className:C.copyButtonIcons,"aria-hidden":"true",children:[(0,u.jsx)(j,{className:C.copyButtonIcon}),(0,u.jsx)(y,{className:C.copyButtonSuccessIcon})]})})}function v(e){return(0,u.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,u.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"})})}const w={wordWrapButtonIcon:"wordWrapButtonIcon_Bwma",wordWrapButtonEnabled:"wordWrapButtonEnabled_EoeP"};function L(e){let{className:t,onClick:n,isEnabled:o}=e;const s=(0,B.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,u.jsx)("button",{type:"button",onClick:n,className:(0,c.Z)("clean-btn",t,o&&w.wordWrapButtonEnabled),"aria-label":s,title:s,children:(0,u.jsx)(v,{className:w.wordWrapButtonIcon,"aria-hidden":"true"})})}function E(e){let{children:t,className:n="",metastring:o,title:s,showLineNumbers:a,language:i}=e;const{prism:{defaultLanguage:p,magicComments:g}}=(0,b.L)(),x=function(e){return e?.toLowerCase()}(i??(0,l.Vo)(n)??p),B=(0,r.p)(),j=(0,f.F)(),y=(0,l.bc)(o)||s,{lineClassNames:C,code:v}=(0,l.nZ)(t,{metastring:o,language:x,magicComments:g}),w=a??(0,l.nt)(o);return(0,u.jsxs)(d,{as:"div",className:(0,c.Z)(n,x&&!n.includes(`language-${x}`)&&`language-${x}`),children:[y&&(0,u.jsx)("div",{className:m.codeBlockTitle,children:y}),(0,u.jsxs)("div",{className:m.codeBlockContent,children:[(0,u.jsx)(h.y$,{theme:B,code:v,language:x??"text",children:e=>{let{className:t,style:n,tokens:o,getLineProps:s,getTokenProps:r}=e;return(0,u.jsx)("pre",{tabIndex:0,ref:j.codeBlockRef,className:(0,c.Z)(t,m.codeBlock,"thin-scrollbar"),style:n,children:(0,u.jsx)("code",{className:(0,c.Z)(m.codeBlockLines,w&&m.codeBlockLinesWithNumbering),children:o.map(((e,t)=>(0,u.jsx)(k,{line:e,getLineProps:s,getTokenProps:r,classNames:C[t],showLineNumbers:w},t)))})})}}),(0,u.jsxs)("div",{className:m.buttonGroup,children:[(j.isEnabled||j.isCodeScrollable)&&(0,u.jsx)(L,{className:m.codeButton,onClick:()=>j.toggle(),isEnabled:j.isEnabled}),(0,u.jsx)(N,{className:m.codeButton,code:v})]})]})]})}function S(e){let{children:t,...n}=e;const c=(0,s.default)(),r=function(e){return o.Children.toArray(e).some((e=>(0,o.isValidElement)(e)))?e:Array.isArray(e)?e.join(""):e}(t),a="string"==typeof r?E:p;return(0,u.jsx)(a,{...n,children:r},String(c))}},85448:(e,t,n)=>{"use strict";n.d(t,{F:()=>a});var o=n(67294),s=n(902);const c={attributes:!0,characterData:!0,childList:!0,subtree:!0};function r(e,t){const[n,r]=(0,o.useState)(),a=(0,o.useCallback)((()=>{r(e.current?.closest("[role=tabpanel][hidden]"))}),[e,r]);(0,o.useEffect)((()=>{a()}),[a]),function(e,t,n){void 0===n&&(n=c);const r=(0,s.zX)(t),a=(0,s.Ql)(n);(0,o.useEffect)((()=>{const t=new MutationObserver(r);return e&&t.observe(e,a),()=>t.disconnect()}),[e,r,a])}(n,(e=>{e.forEach((e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(t(),a())}))}),{attributes:!0,characterData:!1,childList:!1,subtree:!1})}function a(){const[e,t]=(0,o.useState)(!1),[n,s]=(0,o.useState)(!1),c=(0,o.useRef)(null),a=(0,o.useCallback)((()=>{const n=c.current.querySelector("code");e?n.removeAttribute("style"):(n.style.whiteSpace="pre-wrap",n.style.overflowWrap="anywhere"),t((e=>!e))}),[c,e]),l=(0,o.useCallback)((()=>{const{scrollWidth:e,clientWidth:t}=c.current,n=e>t||c.current.querySelector("code").hasAttribute("style");s(n)}),[c]);return r(c,l),(0,o.useEffect)((()=>{l()}),[e,l]),(0,o.useEffect)((()=>(window.addEventListener("resize",l,{passive:!0}),()=>{window.removeEventListener("resize",l)})),[l]),{codeBlockRef:c,isEnabled:e,isCodeScrollable:n,toggle:a}}},66412:(e,t,n)=>{"use strict";n.d(t,{p:()=>c});var o=n(92949),s=n(86668);function c(){const{prism:e}=(0,s.L)(),{colorMode:t}=(0,o.I)(),n=e.theme,c=e.darkTheme||n;return"dark"===t?c:n}},37016:(e,t,n)=>{"use strict";n.d(t,{QC:()=>p,Vo:()=>d,bc:()=>i,nZ:()=>m,nt:()=>u});var o=n(87594),s=n.n(o);const c=/title=(?<quote>["'])(?<title>.*?)\1/,r=/\{(?<range>[\d,-]+)\}/,a={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"},lua:{start:"--",end:""},wasm:{start:"\\;\\;",end:""},tex:{start:"%",end:""}};function l(e,t){const n=e.map((e=>{const{start:n,end:o}=a[e];return`(?:${n}\\s*(${t.flatMap((e=>[e.line,e.block?.start,e.block?.end].filter(Boolean))).join("|")})\\s*${o})`})).join("|");return new RegExp(`^\\s*(?:${n})\\s*$`)}function i(e){return e?.match(c)?.groups.title??""}function u(e){return Boolean(e?.includes("showLineNumbers"))}function d(e){const t=e.split(" ").find((e=>e.startsWith("language-")));return t?.replace(/language-/,"")}function m(e,t){let n=e.replace(/\n$/,"");const{language:o,magicComments:c,metastring:i}=t;if(i&&r.test(i)){const e=i.match(r).groups.range;if(0===c.length)throw new Error(`A highlight range has been given in code block's metastring (\`\`\` ${i}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);const t=c[0].className,o=s()(e).filter((e=>e>0)).map((e=>[e-1,[t]]));return{lineClassNames:Object.fromEntries(o),code:n}}if(void 0===o)return{lineClassNames:{},code:n};const u=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return l(["js","jsBlock"],t);case"jsx":case"tsx":return l(["js","jsBlock","jsx"],t);case"html":return l(["js","jsBlock","html"],t);case"python":case"py":case"bash":return l(["bash"],t);case"markdown":case"md":return l(["html","jsx","bash"],t);case"tex":case"latex":case"matlab":return l(["tex"],t);case"lua":case"haskell":case"sql":return l(["lua"],t);case"wasm":return l(["wasm"],t);default:return l(Object.keys(a).filter((e=>!["lua","wasm","tex","latex","matlab"].includes(e))),t)}}(o,c),d=n.split("\n"),m=Object.fromEntries(c.map((e=>[e.className,{start:0,range:""}]))),p=Object.fromEntries(c.filter((e=>e.line)).map((e=>{let{className:t,line:n}=e;return[n,t]}))),b=Object.fromEntries(c.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.start,t]}))),f=Object.fromEntries(c.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.end,t]})));for(let s=0;s<d.length;){const e=d[s].match(u);if(!e){s+=1;continue}const t=e.slice(1).find((e=>void 0!==e));p[t]?m[p[t]].range+=`${s},`:b[t]?m[b[t]].start=s:f[t]&&(m[f[t]].range+=`${m[f[t]].start}-${s-1},`),d.splice(s,1)}n=d.join("\n");const h={};return Object.entries(m).forEach((e=>{let[t,{range:n}]=e;s()(n).forEach((e=>{h[e]??=[],h[e].push(t)}))})),{lineClassNames:h,code:n}}function p(e){const t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={};return Object.entries(e.plain).forEach((e=>{let[o,s]=e;const c=t[o];c&&"string"==typeof s&&(n[c]=s)})),n}},87594:(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,s,c]=t;if(o&&c){o=parseInt(o),c=parseInt(c);const e=o<c?1:-1;"-"!==s&&".."!==s&&"\u2025"!==s||(c+=e);for(let t=o;t!==c;t+=e)n.push(t)}}return n}t.default=n,e.exports=n},11151:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a,a:()=>r});var o=n(67294);const s={},c=o.createContext(s);function r(e){const t=o.useContext(c);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),o.createElement(c.Provider,{value:t},e.children)}},10195:(e,t,n)=>{"use strict";function o(e,t){let{target:n=document.body}=void 0===t?{}:t;if("string"!=typeof e)throw new TypeError(`Expected parameter \`text\` to be a \`string\`, got \`${typeof e}\`.`);const o=document.createElement("textarea"),s=document.activeElement;o.value=e,o.setAttribute("readonly",""),o.style.contain="strict",o.style.position="absolute",o.style.left="-9999px",o.style.fontSize="12pt";const c=document.getSelection(),r=c.rangeCount>0&&c.getRangeAt(0);n.append(o),o.select(),o.selectionStart=0,o.selectionEnd=e.length;let a=!1;try{a=document.execCommand("copy")}catch{}return o.remove(),r&&(c.removeAllRanges(),c.addRange(r)),s&&s.focus(),a}n.d(t,{Z:()=>o})}}]); |