index.cjs 14 KB

12
  1. function n(n){if(n&&n.__esModule)return n;var e=Object.create(null);return n&&Object.keys(n).forEach(function(t){if("default"!==t){var r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:function(){return n[t]}})}}),e.default=n,e}var e=/*#__PURE__*/n(require("react"));function t(){return t=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},t.apply(this,arguments)}var r=["children","options"],u=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","className","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce(function(n,e){return n[e.toLowerCase()]=e,n},{for:"htmlFor"}),o={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},i=["style","script"],c=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,l=/mailto:/i,a=/\n{2,}$/,f=/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/,s=/^ *> ?/gm,p=/^ {2,}\n/,v=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,d=/^\s*(`{3,}|~{3,}) *(\S+)?([^\n]*?)?\n([\s\S]+?)\s*\1 *(?:\n *)*\n?/,g=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,h=/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,y=/^(?:\n *)*\n/,m=/\r\n?/g,k=/^\[\^([^\]]+)](:.*)\n/,S=/^\[\^([^\]]+)]/,H=/\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.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)==/,K=/^~~((?:\[.*?\]|<.*?>(?:.*?<.*?>)?|`.*?`|.)*?)~~/,Y=/^\\([^0-9A-Za-z\s])/,nn=/^[\s\S]+?(?=[^0-9A-Z\s\u00c0-\uffff&#;.()'"]|\d+\.|\n\n| {2,}\n|\w+:\S|$)/i,en=/^\n+/,tn=/^([ \t]*)/,rn=/\\([^\\])/g,un=/ *\n+$/,on=/(?:^|\n)( *)$/,cn="(?:\\d+\\.)",ln="(?:[*+-])";function an(n){return"( *)("+(1===n?cn:ln)+") +"}var fn=an(1),sn=an(2);function pn(n){return new RegExp("^"+(1===n?fn:sn))}var vn=pn(1),dn=pn(2);function gn(n){return new RegExp("^"+(1===n?fn:sn)+"[^\\n]*(?:\\n(?!\\1"+(1===n?cn:ln)+" )[^\\n]*)*(\\n|$)","gm")}var hn=gn(1),yn=gn(2);function mn(n){var e=1===n?cn:ln;return new RegExp("^( *)("+e+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+e+" (?!"+e+" ))\\n*|\\s*\\n*$)")}var kn=mn(1),Sn=mn(2);function Hn(n,e){var t=1===e,r=t?kn:Sn,u=t?hn:yn,o=t?vn:dn;return{t:function(n,e,t){var u=on.exec(t);return u&&(e.o||!e.u&&!e.i)?r.exec(n=u[1]+n):null},_:Xn.HIGH,l:function(n,e,r){var i=t?+n[2]:void 0,c=n[0].replace(a,"\n").match(u),l=!1;return{p:c.map(function(n,t){var u=o.exec(n)[0].length,i=new RegExp("^ {1,"+u+"}","gm"),a=n.replace(i,"").replace(o,""),f=t===c.length-1,s=-1!==a.indexOf("\n\n")||f&&l;l=s;var p,v=r.u,d=r.o;r.o=!0,s?(r.u=!1,p=a.replace(un,"\n\n")):(r.u=!0,p=a.replace(un,""));var g=e(p,r);return r.u=v,r.o=d,g}),m:t,g:i}},v:function(e,t,r){return n(e.m?"ol":"ul",{key:r.h,start:e.g},e.p.map(function(e,u){return n("li",{key:u},t(e,r))}))}}}var xn=/^\[([^\]]*)]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,_n=/^!\[([^\]]*)]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,bn=[f,d,g,_,M,b,L,D,hn,kn,yn,Sn],Mn=[].concat(bn,[/^[^\n]+(?: \n|\n{2,})/,O,j]);function On(n){return n.replace(/[ÀÁÂÃÄÅàáâãäåæÆ]/g,"a").replace(/[çÇ]/g,"c").replace(/[ðÐ]/g,"d").replace(/[ÈÉÊËéèêë]/g,"e").replace(/[ÏïÎîÍíÌì]/g,"i").replace(/[Ññ]/g,"n").replace(/[øØœŒÕõÔôÓóÒò]/g,"o").replace(/[ÜüÛûÚúÙù]/g,"u").replace(/[ŸÿÝý]/g,"y").replace(/[^a-z0-9- ]/gi,"").replace(/ /gi,"-").toLowerCase()}function In(n){return q.test(n)?"right":U.test(n)?"center":Z.test(n)?"left":null}function Ln(n,e,t){var r=t.k;t.k=!0;var u=e(n.trim(),t);t.k=r;var o=[[]];return u.forEach(function(n,e){"tableSeparator"===n.type?0!==e&&e!==u.length-1&&o.push([]):("text"!==n.type||null!=u[e+1]&&"tableSeparator"!==u[e+1].type||(n.S=n.S.replace(P,"")),o[o.length-1].push(n))}),o}function An(n,e,t){t.u=!0;var r=Ln(n[1],e,t),u=n[2].replace(F,"").split("|").map(In),o=function(n,e,t){return n.trim().split("\n").map(function(n){return Ln(n,e,t)})}(n[3],e,t);return t.u=!1,{$:u,A:o,H:r,type:"table"}}function jn(n,e){return null==n.$[e]?{}:{textAlign:n.$[e]}}function Gn(n){return function(e,t){return t.u?n.exec(e):null}}function Cn(n){return function(e,t){return t.u||t.i?n.exec(e):null}}function En(n){return function(e,t){return t.u||t.i?null:n.exec(e)}}function $n(n){return function(e){return n.exec(e)}}function wn(n,e,t){if(e.u||e.i)return null;if(t&&!t.endsWith("\n"))return null;var r="";n.split("\n").every(function(n){return!bn.some(function(e){return e.test(n)})&&(r+=n+"\n",n.trim())});var u=r.trimEnd();return""==u?null:[r,u]}function Dn(n){try{if(decodeURIComponent(n).replace(/[^A-Za-z0-9/:]/g,"").match(/^\s*(javascript|vbscript|data(?!:image)):/i))return}catch(n){return null}return n}function Nn(n){return n.replace(rn,"$1")}function Tn(n,e,t){var r=t.u||!1,u=t.i||!1;t.u=!0,t.i=!0;var o=n(e,t);return t.u=r,t.i=u,o}function zn(n,e,t){var r=t.u||!1,u=t.i||!1;t.u=!1,t.i=!0;var o=n(e,t);return t.u=r,t.i=u,o}function Wn(n,e,t){return t.u=!1,n(e,t)}var Xn,Bn,Rn=function(n,e,t){return{S:Tn(e,n[1],t)}};function Fn(){return{}}function Pn(){return null}function Un(){return[].slice.call(arguments).filter(Boolean).join(" ")}function Zn(n,e,t){for(var r=n,u=e.split(".");u.length&&void 0!==(r=r[u[0]]);)u.shift();return r||t}function qn(n,e){var t=Zn(e,n);return t?"function"==typeof t||"object"==typeof t&&"render"in t?t:Zn(e,n+".component",n):n}function Vn(n,r){void 0===r&&(r={}),r.overrides=r.overrides||{},r.slugify=r.slugify||On,r.namedCodesToUnicode=r.namedCodesToUnicode?t({},o,r.namedCodesToUnicode):o;var a=r.createElement||e.createElement;function F(n,e){var u=Zn(r.overrides,n+".props",{});return a.apply(void 0,[qn(n,r.overrides),t({},e,u,{className:Un(null==e?void 0:e.className,u.className)||void 0})].concat([].slice.call(arguments,2)))}function P(n){var t=!1;r.forceInline?t=!0:r.forceBlock||(t=!1===X.test(n));for(var u=ln(cn(t?n:n.trimEnd().replace(en,"")+"\n\n",{u:t}));"string"==typeof u[u.length-1]&&!u[u.length-1].trim();)u.pop();if(null===r.wrapper)return u;var o,i=r.wrapper||(t?"span":"div");if(u.length>1||r.forceWrapper)o=u;else{if(1===u.length)return"string"==typeof(o=u[0])?F("span",{key:"outer"},o):o;o=null}return e.createElement(i,{key:"outer"},o)}function U(n){var t=n.match(c);return t?t.reduce(function(n,t,r){var o,i=t.indexOf("=");if(-1!==i){var c=(o=t.slice(0,i),-1!==o.indexOf("-")&&null===o.match(A)&&(o=o.replace(w,function(n,e){return e.toUpperCase()})),o).trim(),l=function(n){var e=n[0];return('"'===e||"'"===e)&&n.length>=2&&n[n.length-1]===e?n.slice(1,-1):n}(t.slice(i+1).trim()),a=u[c]||c,f=n[a]=function(n,e){return"style"===n?e.split(/;\s?/).reduce(function(n,e){var t=e.slice(0,e.indexOf(":"));return n[t.replace(/(-[a-z])/g,function(n){return n[1].toUpperCase()})]=e.slice(t.length+1).trim(),n},{}):"href"===n?Dn(e):(e.match(G)&&(e=e.slice(1,e.length-1)),"true"===e||"false"!==e&&e)}(c,l);"string"==typeof f&&(O.test(f)||j.test(f))&&(n[a]=e.cloneElement(P(f.trim()),{key:r}))}else"style"!==t&&(n[u[t]||t]=!0);return n},{}):null}var Z=[],q={},rn={blockQuote:{t:En(f),_:Xn.HIGH,l:function(n,e,t){return{S:e(n[0].replace(s,""),t)}},v:function(n,e,t){return F("blockquote",{key:t.h},e(n.S,t))}},breakLine:{t:$n(p),_:Xn.HIGH,l:Fn,v:function(n,e,t){return F("br",{key:t.h})}},breakThematic:{t:En(v),_:Xn.HIGH,l:Fn,v:function(n,e,t){return F("hr",{key:t.h})}},codeBlock:{t:En(g),_:Xn.MAX,l:function(n){return{S:n[0].replace(/^ {4}/gm,"").replace(/\n+$/,""),L:void 0}},v:function(n,e,r){return console.log("AHHHHHHHH"),"latex"===n.L?F("div",{key:r.h},n.S):F("pre",{key:r.h},F("code",t({},n.M,{className:n.L?"lang-"+n.L:""}),n.S))}},codeFenced:{t:En(d),_:Xn.MAX,l:function(n){return console.log(n),{M:U(n[3]||""),S:n[4],L:n[2]||void 0,type:"codeBlock"}}},codeInline:{t:Cn(h),_:Xn.LOW,l:function(n){return{S:n[2]}},v:function(n,e,t){return F("code",{key:t.h},n.S)}},footnote:{t:En(k),_:Xn.MAX,l:function(n){return Z.push({O:n[2],I:n[1]}),{}},v:Pn},footnoteReference:{t:Gn(S),_:Xn.HIGH,l:function(n){return{S:n[1],j:"#"+r.slugify(n[1])}},v:function(n,e,t){return F("a",{key:t.h,href:Dn(n.j)},F("sup",{key:t.h},n.S))}},gfmTask:{t:Gn(x),_:Xn.HIGH,l:function(n){return{B:"x"===n[1].toLowerCase()}},v:function(n,e,t){return F("input",{checked:n.B,key:t.h,readOnly:!0,type:"checkbox"})}},heading:{t:En(r.enforceAtxHeadings?b:_),_:Xn.HIGH,l:function(n,e,t){return{S:Tn(e,n[2],t),R:r.slugify(n[2]),T:n[1].length}},v:function(n,e,t){return F("h"+n.T,{id:n.R,key:t.h},e(n.S,t))}},headingSetext:{t:En(M),_:Xn.MAX,l:function(n,e,t){return{S:Tn(e,n[1],t),T:"="===n[2]?1:2,type:"heading"}}},htmlComment:{t:$n(L),_:Xn.HIGH,l:function(){return{}},v:Pn},image:{t:Cn(_n),_:Xn.HIGH,l:function(n){return{C:n[1],j:Nn(n[2]),D:n[3]}},v:function(n,e,t){return F("img",{key:t.h,alt:n.C||void 0,title:n.D||void 0,src:Dn(n.j)})}},link:{t:Gn(xn),_:Xn.LOW,l:function(n,e,t){return{S:zn(e,n[1],t),j:Nn(n[2]),D:n[3]}},v:function(n,e,t){return F("a",{key:t.h,href:Dn(n.j),title:n.D},e(n.S,t))}},linkAngleBraceStyleDetector:{t:Gn($),_:Xn.MAX,l:function(n){return{S:[{S:n[1],type:"text"}],j:n[1],type:"link"}}},linkBareUrlDetector:{t:function(n,e){return e.F?null:Gn(C)(n,e)},_:Xn.MAX,l:function(n){return{S:[{S:n[1],type:"text"}],j:n[1],D:void 0,type:"link"}}},linkMailtoDetector:{t:Gn(E),_:Xn.MAX,l:function(n){var e=n[1],t=n[1];return l.test(t)||(t="mailto:"+t),{S:[{S:e.replace("mailto:",""),type:"text"}],j:t,type:"link"}}},orderedList:Hn(F,1),unorderedList:Hn(F,2),newlineCoalescer:{t:En(y),_:Xn.LOW,l:Fn,v:function(){return"\n"}},paragraph:{t:wn,_:Xn.LOW,l:Rn,v:function(n,e,t){return F("p",{key:t.h},e(n.S,t))}},ref:{t:Gn(N),_:Xn.MAX,l:function(n){return q[n[1]]={j:n[2],D:n[4]},{}},v:Pn},refImage:{t:Cn(T),_:Xn.MAX,l:function(n){return{C:n[1]||void 0,N:n[2]}},v:function(n,e,t){return F("img",{key:t.h,alt:n.C,src:Dn(q[n.N].j),title:q[n.N].D})}},refLink:{t:Gn(z),_:Xn.MAX,l:function(n,e,t){return{S:e(n[1],t),P:e(n[0].replace(W,"\\$1"),t),N:n[2]}},v:function(n,e,t){return q[n.N]?F("a",{key:t.h,href:Dn(q[n.N].j),title:q[n.N].D},e(n.S,t)):F("span",{key:t.h},e(n.P,t))}},table:{t:En(D),_:Xn.HIGH,l:An,v:function(n,e,t){return F("table",{key:t.h},F("thead",null,F("tr",null,n.H.map(function(r,u){return F("th",{key:u,style:jn(n,u)},e(r,t))}))),F("tbody",null,n.A.map(function(r,u){return F("tr",{key:u},r.map(function(r,u){return F("td",{key:u,style:jn(n,u)},e(r,t))}))})))}},tableSeparator:{t:function(n,e){return e.k?(e.u=!0,R.exec(n)):null},_:Xn.HIGH,l:function(){return{type:"tableSeparator"}},v:function(){return" | "}},text:{t:$n(nn),_:Xn.MIN,l:function(n){return{S:n[0].replace(I,function(n,e){return r.namedCodesToUnicode[e]?r.namedCodesToUnicode[e]:n})}},v:function(n){return n.S}},textBolded:{t:Cn(V),_:Xn.MED,l:function(n,e,t){return{S:e(n[2],t)}},v:function(n,e,t){return F("strong",{key:t.h},e(n.S,t))}},textEmphasized:{t:Cn(Q),_:Xn.LOW,l:function(n,e,t){return{S:e(n[2],t)}},v:function(n,e,t){return F("em",{key:t.h},e(n.S,t))}},textEscaped:{t:Cn(Y),_:Xn.HIGH,l:function(n){return{S:n[1],type:"text"}}},textMarked:{t:Cn(J),_:Xn.LOW,l:Rn,v:function(n,e,t){return F("mark",{key:t.h},e(n.S,t))}},textStrikethroughed:{t:Cn(K),_:Xn.LOW,l:Rn,v:function(n,e,t){return F("del",{key:t.h},e(n.S,t))}}};!0!==r.disableParsingRawHTML&&(rn.htmlBlock={t:$n(O),_:Xn.HIGH,l:function(n,e,t){var r,u=n[3].match(tn),o=new RegExp("^"+u[1],"gm"),c=n[3].replace(o,""),l=(r=c,Mn.some(function(n){return n.test(r)})?Wn:Tn),a=n[1].toLowerCase(),f=-1!==i.indexOf(a);t.F=t.F||"a"===a;var s=f?n[3]:l(e,c,t);return t.F=!1,{M:U(n[2]),S:s,Z:f,G:f?a:n[1]}},v:function(n,e,r){return F(n.G,t({key:r.h},n.M),n.Z?n.S:e(n.S,r))}},rn.htmlSelfClosing={t:$n(j),_:Xn.HIGH,l:function(n){return{M:U(n[2]||""),G:n[1]}},v:function(n,e,r){return F(n.G,t({},n.M,{key:r.h}))}});var un,on,cn=function(n){var e=Object.keys(n);function t(r,u){for(var o=[],i="";r;)for(var c=0;c<e.length;){var l=e[c],a=n[l],f=a.t(r,u,i);if(f){var s=f[0];r=r.substring(s.length);var p=a.l(f,t,u);null==p.type&&(p.type=l),o.push(p),i=s;break}c++}return o}return e.sort(function(e,t){var r=n[e]._,u=n[t]._;return r!==u?r-u:e<t?-1:1}),function(n,e){return t(function(n){return n.replace(m,"\n").replace(H,"").replace(B," ")}(n),e)}}(rn),ln=(on=rn,un=function(n,e,t){return on[n.type].v(n,e,t)},function n(e,t){if(void 0===t&&(t={}),Array.isArray(e)){for(var r=t.h,u=[],o=!1,i=0;i<e.length;i++){t.h=i;var c=n(e[i],t),l="string"==typeof c;l&&o?u[u.length-1]+=c:null!==c&&u.push(c),o=l}return t.h=r,u}return un(e,n,t)}),an=P(n);return Z.length?F("div",null,an,F("footer",{key:"footer"},Z.map(function(n){return F("div",{id:r.slugify(n.I),key:n.I},n.I,ln(cn(n.O,{u:!0})))}))):an}function Qn(n){var t=n.children,u=n.options,o=function(n,e){if(null==n)return{};var t,r,u={},o=Object.keys(n);for(r=0;r<o.length;r++)e.indexOf(t=o[r])>=0||(u[t]=n[t]);return u}(n,r);return e.cloneElement(Vn(t,u),o)}(Bn=Xn||(Xn={}))[Bn.MAX=0]="MAX",Bn[Bn.HIGH=1]="HIGH",Bn[Bn.MED=2]="MED",Bn[Bn.LOW=3]="LOW",Bn[Bn.MIN=4]="MIN",Object.assign(Qn,{compiler:Vn}),module.exports=Qn;
  2. //# sourceMappingURL=index.cjs.map