@observablehq/stdlib
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -1,2 +0,2 @@ | ||
// @observablehq/stdlib v3.0.0 Copyright 2019 Observable, Inc. | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.observablehq=e.observablehq||{})}(this,function(e){"use strict";function t(e){return function(){return e}}var n={math:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};var r=0;function i(e){this.id=e,this.href=window.location.href+"#"+e}i.prototype.toString=function(){return"url("+this.href+")"};var s={canvas:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},context2d:function(e,t,n){null==n&&(n=devicePixelRatio);var r=document.createElement("canvas");r.width=e*n,r.height=t*n,r.style.width=e+"px";var i=r.getContext("2d");return i.scale(n,n),i},download:function(e,t="untitled",n="Save"){const r=document.createElement("a"),i=r.appendChild(document.createElement("button"));async function s(){await new Promise(requestAnimationFrame),URL.revokeObjectURL(r.href),r.removeAttribute("href"),i.textContent=n,i.disabled=!1}return i.textContent=n,r.download=t,r.onclick=(async t=>{if(i.disabled=!0,r.href)return s();i.textContent="Saving…";try{const t=await("function"==typeof e?e():e);i.textContent="Download",r.href=URL.createObjectURL(t)}catch(e){i.textContent=n}if(t.eventPhase)return s();i.disabled=!1}),r},element:function(e,t){var r,i=e+="",s=i.indexOf(":");s>=0&&"xmlns"!==(i=e.slice(0,s))&&(e=e.slice(s+1));var o=n.hasOwnProperty(i)?document.createElementNS(n[i],e):document.createElement(e);if(t)for(var l in t)s=(i=l).indexOf(":"),r=t[l],s>=0&&"xmlns"!==(i=l.slice(0,s))&&(l=l.slice(s+1)),n.hasOwnProperty(i)?o.setAttributeNS(n[i],l,r):o.setAttribute(l,r);return o},input:function(e){var t=document.createElement("input");return null!=e&&(t.type=e),t},range:function(e,t,n){1===arguments.length&&(t=e,e=null);var r=document.createElement("input");return r.min=e=null==e?0:+e,r.max=t=null==t?1:+t,r.step=null==n?"any":n=+n,r.type="range",r},select:function(e){var t=document.createElement("select");return Array.prototype.forEach.call(e,function(e){var n=document.createElement("option");n.value=n.textContent=e,t.appendChild(n)}),t},svg:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("viewBox",[0,0,e,t]),n.setAttribute("width",e),n.setAttribute("height",t),n},text:function(e){return document.createTextNode(e)},uid:function(e){return new i("O-"+(null==e?"":e+"-")+ ++r)}};var o={buffer:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)})},text:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsText(e)})},url:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsDataURL(e)})}};function l(){return this}function a(e,t){let n=!1;return{[Symbol.iterator]:l,next:()=>n?{done:!0}:(n=!0,{done:!1,value:e}),return:()=>(n=!0,t(e),{done:!0}),throw:()=>({done:n=!0})}}function u(e){let t,n,r=!1;const i=e(function(e){n?(n(e),n=null):r=!0;return t=e});return{[Symbol.iterator]:l,throw:()=>({done:!0}),return:()=>(null!=i&&i(),{done:!0}),next:function(){return{done:!1,value:r?(r=!1,Promise.resolve(t)):new Promise(e=>n=e)}}}}function c(e){switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files[0];default:return e.value}}var h={disposable:a,filter:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)t(n.value,++r)&&(yield n.value)},input:function(e){return u(function(t){var n=function(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}(e),r=c(e);function i(){t(c(e))}return e.addEventListener(n,i),void 0!==r&&t(r),function(){e.removeEventListener(n,i)}})},map:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)yield t(n.value,++r)},observe:u,queue:function(e){let t;const n=[],r=e(function(e){return n.push(e),t&&(t(n.shift()),t=null),e});return{[Symbol.iterator]:l,throw:()=>({done:!0}),return:()=>(null!=r&&r(),{done:!0}),next:function(){return{done:!1,value:n.length?Promise.resolve(n.shift()):new Promise(e=>t=e)}}}},range:function*(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n));++r<i;)yield e+r*n},valueAt:function(e,t){if(!(!isFinite(t=+t)||t<0||t!=t|0))for(var n,r=-1;!(n=e.next()).done;)if(++r===t)return n.value},worker:function(e){const t=URL.createObjectURL(new Blob([e],{type:"text/javascript"})),n=new Worker(t);return a(n,()=>{n.terminate(),URL.revokeObjectURL(t)})}};function p(e,t){return function(n){var r,i,s,o,l,a,u,c,h=n[0],p=[],f=null,g=-1;for(l=1,a=arguments.length;l<a;++l){if((r=arguments[l])instanceof Node)p[++g]=r,h+="\x3c!--o:"+g+"--\x3e";else if(Array.isArray(r)){for(u=0,c=r.length;u<c;++u)(i=r[u])instanceof Node?(null===f&&(p[++g]=f=document.createDocumentFragment(),h+="\x3c!--o:"+g+"--\x3e"),f.appendChild(i)):(f=null,h+=i);f=null}else h+=r;h+=n[l]}if(f=e(h),++g>0){for(s=new Array(g),o=document.createTreeWalker(f,NodeFilter.SHOW_COMMENT,null,!1);o.nextNode();)i=o.currentNode,/^o:/.test(i.nodeValue)&&(s[+i.nodeValue.slice(2)]=i);for(l=0;l<g;++l)(i=s[l])&&i.parentNode.replaceChild(p[l],i)}return 1===f.childNodes.length?f.removeChild(f.firstChild):11===f.nodeType?((i=t()).appendChild(f),i):f}}var f=p(function(e){var t=document.createElement("template");return t.innerHTML=e.trim(),document.importNode(t.content,!0)},function(){return document.createElement("span")}),g={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:E,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,nptable:E,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:E,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/,text:/^[^\n]+/};function d(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||O.defaults,this.rules=g.normal,this.options.pedantic?this.rules=g.pedantic:this.options.gfm&&(this.options.tables?this.rules=g.tables:this.rules=g.gfm)}g._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,g._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,g.def=$(g.def).replace("label",g._label).replace("title",g._title).getRegex(),g.bullet=/(?:[*+-]|\d{1,9}\.)/,g.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,g.item=$(g.item,"gm").replace(/bull/g,g.bullet).getRegex(),g.list=$(g.list).replace(/bull/g,g.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+g.def.source+")").getRegex(),g._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",g._comment=/<!--(?!-?>)[\s\S]*?-->/,g.html=$(g.html,"i").replace("comment",g._comment).replace("tag",g._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),g.paragraph=$(g.paragraph).replace("hr",g.hr).replace("heading",g.heading).replace("lheading",g.lheading).replace("tag",g._tag).getRegex(),g.blockquote=$(g.blockquote).replace("paragraph",g.paragraph).getRegex(),g.normal=L({},g),g.gfm=L({},g.normal,{fences:/^ {0,3}(`{3,}|~{3,})([^`\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),g.gfm.paragraph=$(g.paragraph).replace("(?!","(?!"+g.gfm.fences.source.replace("\\1","\\2")+"|"+g.list.source.replace("\\1","\\3")+"|").getRegex(),g.tables=L({},g.gfm,{nptable:/^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,table:/^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/}),g.pedantic=L({},g.normal,{html:$("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",g._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),d.rules=g,d.lex=function(e,t){return new d(t).lex(e)},d.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},d.prototype.token=function(e,t){var n,r,i,s,o,l,a,u,c,h,p,f,d,m,b,w;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:z(i,"\n")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2]?i[2].trim():i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if((i=this.rules.nptable.exec(e))&&(l={type:"table",header:P(i[1].replace(/^ *| *\| *$/g,"")),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3]?i[3].replace(/\n$/,"").split("\n"):[]}).header.length===l.align.length){for(e=e.substring(i[0].length),p=0;p<l.align.length;p++)/^ *-+: *$/.test(l.align[p])?l.align[p]="right":/^ *:-+: *$/.test(l.align[p])?l.align[p]="center":/^ *:-+ *$/.test(l.align[p])?l.align[p]="left":l.align[p]=null;for(p=0;p<l.cells.length;p++)l.cells[p]=P(l.cells[p],l.header.length);this.tokens.push(l)}else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,t),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),a={type:"list_start",ordered:m=(s=i[2]).length>1,start:m?+s:"",loose:!1},this.tokens.push(a),u=[],n=!1,d=(i=i[0].match(this.rules.item)).length,p=0;p<d;p++)h=(l=i[p]).length,~(l=l.replace(/^ *([*+-]|\d+\.) */,"")).indexOf("\n ")&&(h-=l.length,l=this.options.pedantic?l.replace(/^ {1,4}/gm,""):l.replace(new RegExp("^ {1,"+h+"}","gm"),"")),p!==d-1&&(o=g.bullet.exec(i[p+1])[0],(s.length>1?1===o.length:o.length>1||this.options.smartLists&&o!==s)&&(e=i.slice(p+1).join("\n")+e,p=d-1)),r=n||/\n\n(?!\s*$)/.test(l),p!==d-1&&(n="\n"===l.charAt(l.length-1),r||(r=n)),r&&(a.loose=!0),w=void 0,(b=/^\[[ xX]\] /.test(l))&&(w=" "!==l[1],l=l.replace(/^\[[ xX]\] +/,"")),c={type:"list_item_start",task:b,checked:w,loose:r},u.push(c),this.tokens.push(c),this.token(l,!1),this.tokens.push({type:"list_item_end"});if(a.loose)for(d=u.length,p=0;p<d;p++)u[p].loose=!0;this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),f=i[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[f]||(this.tokens.links[f]={href:i[2],title:i[3]});else if((i=this.rules.table.exec(e))&&(l={type:"table",header:P(i[1].replace(/^ *| *\| *$/g,"")),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3]?i[3].replace(/\n$/,"").split("\n"):[]}).header.length===l.align.length){for(e=e.substring(i[0].length),p=0;p<l.align.length;p++)/^ *-+: *$/.test(l.align[p])?l.align[p]="right":/^ *:-+: *$/.test(l.align[p])?l.align[p]="center":/^ *:-+ *$/.test(l.align[p])?l.align[p]="left":l.align[p]=null;for(p=0;p<l.cells.length;p++)l.cells[p]=P(l.cells[p].replace(/^ *\| *| *\| *$/g,""),l.header.length);this.tokens.push(l)}else if(i=this.rules.lheading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:"="===i[2]?1:2,text:i[1]});else if(t&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"===i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var m={escape:/^\\([!"#$%&'()*+,\-.\/:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:E,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,em:/^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s"<\[][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:E,text:/^(`+|[^`])[\s\S]*?(?=[\\<!\[`*]|\b_| {2,}\n|$)/};function b(e,t){if(this.options=t||O.defaults,this.links=e,this.rules=m.normal,this.renderer=this.options.renderer||new w,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.pedantic?this.rules=m.pedantic:this.options.gfm&&(this.options.breaks?this.rules=m.breaks:this.rules=m.gfm)}function w(e){this.options=e||O.defaults}function x(){}function k(e){this.tokens=[],this.token=null,this.options=e||O.defaults,this.options.renderer=this.options.renderer||new w,this.renderer=this.options.renderer,this.renderer.options=this.options,this.slugger=new v}function v(){this.seen={}}function y(e,t){if(t){if(y.escapeTest.test(e))return e.replace(y.escapeReplace,function(e){return y.replacements[e]})}else if(y.escapeTestNoEncode.test(e))return e.replace(y.escapeReplaceNoEncode,function(e){return y.replacements[e]});return e}function _(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function $(e,t){return e=e.source||e,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function S(e,t,n){if(e){try{var r=decodeURIComponent(_(n)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return null}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return null}t&&!R.test(n)&&(n=function(e,t){A[" "+e]||(/^[^:]+:\/*[^\/]*$/.test(e)?A[" "+e]=e+"/":A[" "+e]=z(e,"/",!0));return e=A[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^\/]*)[\s\S]*/,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}m._punctuation="!\"#$%&'()*+,\\-./:;<=>?@\\[^_{|}~",m.em=$(m.em).replace(/punctuation/g,m._punctuation).getRegex(),m._escapes=/\\([!"#$%&'()*+,\-.\/:;<=>?@\[\]\\^_`{|}~])/g,m._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,m._email=/[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,m.autolink=$(m.autolink).replace("scheme",m._scheme).replace("email",m._email).getRegex(),m._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,m.tag=$(m.tag).replace("comment",g._comment).replace("attribute",m._attribute).getRegex(),m._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|`(?!`)|[^\[\]\\`])*?/,m._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*)/,m._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,m.link=$(m.link).replace("label",m._label).replace("href",m._href).replace("title",m._title).getRegex(),m.reflink=$(m.reflink).replace("label",m._label).getRegex(),m.normal=L({},m),m.pedantic=L({},m.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:$(/^!?\[(label)\]\((.*?)\)/).replace("label",m._label).getRegex(),reflink:$(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",m._label).getRegex()}),m.gfm=L({},m.normal,{escape:$(m.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:$(m.text).replace("]|","~]|").replace("|$","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|$").getRegex()}),m.gfm.url=$(m.gfm.url,"i").replace("email",m.gfm._extended_email).getRegex(),m.breaks=L({},m.gfm,{br:$(m.br).replace("{2,}","*").getRegex(),text:$(m.gfm.text).replace("{2,}","*").getRegex()}),b.rules=m,b.output=function(e,t,n){return new b(t,n).output(e)},b.prototype.output=function(e){for(var t,n,r,i,s,o,l="";e;)if(s=this.rules.escape.exec(e))e=e.substring(s[0].length),l+=y(s[1]);else if(s=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(s[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(s[0])&&(this.inLink=!1),!this.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(s[0])?this.inRawBlock=!0:this.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(s[0])&&(this.inRawBlock=!1),e=e.substring(s[0].length),l+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):y(s[0]):s[0];else if(s=this.rules.link.exec(e)){var a=C(s[2],"()");if(a>-1){var u=s[0].length-(s[2].length-a)-(s[3]||"").length;s[2]=s[2].substring(0,a),s[0]=s[0].substring(0,u).trim(),s[3]=""}e=e.substring(s[0].length),this.inLink=!0,r=s[2],this.options.pedantic?(t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r))?(r=t[1],i=t[3]):i="":i=s[3]?s[3].slice(1,-1):"",r=r.trim().replace(/^<([\s\S]*)>$/,"$1"),l+=this.outputLink(s,{href:b.escapes(r),title:b.escapes(i)}),this.inLink=!1}else if((s=this.rules.reflink.exec(e))||(s=this.rules.nolink.exec(e))){if(e=e.substring(s[0].length),t=(s[2]||s[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){l+=s[0].charAt(0),e=s[0].substring(1)+e;continue}this.inLink=!0,l+=this.outputLink(s,t),this.inLink=!1}else if(s=this.rules.strong.exec(e))e=e.substring(s[0].length),l+=this.renderer.strong(this.output(s[4]||s[3]||s[2]||s[1]));else if(s=this.rules.em.exec(e))e=e.substring(s[0].length),l+=this.renderer.em(this.output(s[6]||s[5]||s[4]||s[3]||s[2]||s[1]));else if(s=this.rules.code.exec(e))e=e.substring(s[0].length),l+=this.renderer.codespan(y(s[2].trim(),!0));else if(s=this.rules.br.exec(e))e=e.substring(s[0].length),l+=this.renderer.br();else if(s=this.rules.del.exec(e))e=e.substring(s[0].length),l+=this.renderer.del(this.output(s[1]));else if(s=this.rules.autolink.exec(e))e=e.substring(s[0].length),r="@"===s[2]?"mailto:"+(n=y(this.mangle(s[1]))):n=y(s[1]),l+=this.renderer.link(r,null,n);else if(this.inLink||!(s=this.rules.url.exec(e))){if(s=this.rules.text.exec(e))e=e.substring(s[0].length),this.inRawBlock?l+=this.renderer.text(s[0]):l+=this.renderer.text(y(this.smartypants(s[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else{if("@"===s[2])r="mailto:"+(n=y(s[0]));else{do{o=s[0],s[0]=this.rules._backpedal.exec(s[0])[0]}while(o!==s[0]);n=y(s[0]),r="www."===s[1]?"http://"+n:n}e=e.substring(s[0].length),l+=this.renderer.link(r,null,n)}return l},b.escapes=function(e){return e?e.replace(b.rules._escapes,"$1"):e},b.prototype.outputLink=function(e,t){var n=t.href,r=t.title?y(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,y(e[1]))},b.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},b.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;i<r;i++)t=e.charCodeAt(i),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},w.prototype.code=function(e,t,n){var r=(t||"").match(/\S*/)[0];if(this.options.highlight){var i=this.options.highlight(e,r);null!=i&&i!==e&&(n=!0,e=i)}return r?'<pre><code class="'+this.options.langPrefix+y(r,!0)+'">'+(n?e:y(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:y(e,!0))+"</code></pre>"},w.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},w.prototype.html=function(e){return e},w.prototype.heading=function(e,t,n,r){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+r.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},w.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},w.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"},w.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},w.prototype.checkbox=function(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},w.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},w.prototype.table=function(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"},w.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},w.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},w.prototype.strong=function(e){return"<strong>"+e+"</strong>"},w.prototype.em=function(e){return"<em>"+e+"</em>"},w.prototype.codespan=function(e){return"<code>"+e+"</code>"},w.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},w.prototype.del=function(e){return"<del>"+e+"</del>"},w.prototype.link=function(e,t,n){if(null===(e=S(this.options.sanitize,this.options.baseUrl,e)))return n;var r='<a href="'+y(e)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>"},w.prototype.image=function(e,t,n){if(null===(e=S(this.options.sanitize,this.options.baseUrl,e)))return n;var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},w.prototype.text=function(e){return e},x.prototype.strong=x.prototype.em=x.prototype.codespan=x.prototype.del=x.prototype.text=function(e){return e},x.prototype.link=x.prototype.image=function(e,t,n){return""+n},x.prototype.br=function(){return""},k.parse=function(e,t){return new k(t).parse(e)},k.prototype.parse=function(e){this.inline=new b(e.links,this.options),this.inlineText=new b(e.links,L({},this.options,{renderer:new x})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},k.prototype.next=function(){return this.token=this.tokens.pop()},k.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},k.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},k.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,_(this.inlineText.output(this.token.text)),this.slugger);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,i="",s="";for(n="",e=0;e<this.token.header.length;e++)n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(i+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",r=0;r<t.length;r++)n+=this.renderer.tablecell(this.inline.output(t[r]),{header:!1,align:this.token.align[r]});s+=this.renderer.tablerow(n)}return this.renderer.table(i,s);case"blockquote_start":for(s="";"blockquote_end"!==this.next().type;)s+=this.tok();return this.renderer.blockquote(s);case"list_start":s="";for(var o=this.token.ordered,l=this.token.start;"list_end"!==this.next().type;)s+=this.tok();return this.renderer.list(s,o,l);case"list_item_start":s="";var a=this.token.loose,u=this.token.checked,c=this.token.task;for(this.token.task&&(s+=this.renderer.checkbox(u));"list_item_end"!==this.next().type;)s+=a||"text"!==this.token.type?this.tok():this.parseText();return this.renderer.listitem(s,c,u);case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText());default:var h='Token with "'+this.token.type+'" type was not found.';if(!this.options.silent)throw new Error(h);console.log(h)}},v.prototype.slug=function(e){var t=e.toLowerCase().trim().replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,.\/:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t)){var n=t;do{this.seen[n]++,t=n+"-"+this.seen[n]}while(this.seen.hasOwnProperty(t))}return this.seen[t]=0,t},y.escapeTest=/[&<>"']/,y.escapeReplace=/[&<>"']/g,y.replacements={"&":"&","<":"<",">":">",'"':""","'":"'"},y.escapeTestNoEncode=/[<>"']|&(?!#?\w+;)/,y.escapeReplaceNoEncode=/[<>"']|&(?!#?\w+;)/g;var A={},R=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function E(){}function L(e){for(var t,n,r=1;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function P(e,t){var n=e.replace(/\|/g,function(e,t,n){for(var r=!1,i=t;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"}).split(/ \|/),r=0;if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function z(e,t,n){if(0===e.length)return"";for(var r=0;r<e.length;){var i=e.charAt(e.length-r-1);if(i!==t||n){if(i===t||!n)break;r++}else r++}return e.substr(0,e.length-r)}function C(e,t){if(-1===e.indexOf(t[1]))return-1;for(var n=0,r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&--n<0)return r;return-1}function O(e,t,n){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if(n||"function"==typeof t){n||(n=t,t=null);var r,i,s=(t=L({},O.defaults,t||{})).highlight,o=0;try{r=d.lex(e,t)}catch(e){return n(e)}i=r.length;var l=function(e){if(e)return t.highlight=s,n(e);var i;try{i=k.parse(r,t)}catch(t){e=t}return t.highlight=s,e?n(e):n(null,i)};if(!s||s.length<3)return l();if(delete t.highlight,!i)return l();for(;o<r.length;o++)!function(e){"code"!==e.type?--i||l():s(e.text,e.lang,function(t,n){return t?l(t):null==n||n===e.text?--i||l():(e.text=n,e.escaped=!0,void(--i||l()))})}(r[o])}else try{return t&&(t=L({},O.defaults,t)),k.parse(d.lex(e,t),t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",(t||O.defaults).silent)return"<p>An error occurred:</p><pre>"+y(e.message+"",!0)+"</pre>";throw e}}function j(e){return function(){return p(function(t){var n=document.createElement("div");n.innerHTML=O(t,{langPrefix:""}).trim();var r=n.querySelectorAll("pre code[class]");return r.length>0&&e("@observablehq/highlight.js@1.1.1/highlight.min.js").then(function(e){r.forEach(function(t){e.highlightBlock(t),t.parentNode.classList.add("observablehq--md-pre")})}),n},function(){return document.createElement("div")})}}function q(e){let t;Object.defineProperties(this,{generator:{value:u(e=>void(t=e))},value:{get:()=>e,set:n=>t(e=n)}}),void 0!==e&&t(e)}function*T(){for(;;)yield Date.now()}E.exec=E,O.options=O.setOptions=function(e){return L(O.defaults,e),O},O.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:new w,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},O.defaults=O.getDefaults(),O.Parser=k,O.parser=k.parse,O.Renderer=w,O.TextRenderer=x,O.Lexer=d,O.lexer=d.lex,O.InlineLexer=b,O.inlineLexer=b.output,O.Slugger=v,O.parse=O;var Z=new Map;function N(e,n){var r;return(r=Z.get(e=+e))?r.then(t(n)):(r=Date.now())>=e?Promise.resolve(n):function(e,t){var n=new Promise(function(n){Z.delete(t);var r=t-e;if(!(r>0))throw new Error("invalid time");if(r>2147483647)throw new Error("too long to wait");setTimeout(n,r)});return Z.set(t,n),n}(r,e).then(t(n))}var M={delay:function(e,t){return new Promise(function(n){setTimeout(function(){n(t)},e)})},tick:function(e,t){return N(Math.ceil((Date.now()+1)/e)*e,t)},when:N};function U(e,t){if(/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new Error("illegal name");return"https://unpkg.com/"+e}const D=new Map,F=[],B=F.map,I=F.some,W=F.hasOwnProperty,H="https://cdn.jsdelivr.net/npm/",X=/^((?:@[^\/@]+\/)?[^\/@]+)(?:@([^\/]+))?(?:\/(.*))?$/,V=/^\d+\.\d+\.\d+(-[\w-.+]+)?$/,G=/\.[^\/]*$/,J=["unpkg","jsdelivr","browser","main"];class RequireError extends Error{constructor(e){super(e)}}function K(e){const t=X.exec(e);return t&&{name:t[1],version:t[2],path:t[3]}}function Q(e){const t=`${H}${e.name}${e.version?`@${e.version}`:""}/package.json`;let n=D.get(t);return n||D.set(t,n=fetch(t).then(e=>{if(!e.ok)throw new RequireError("unable to load package.json");return e.redirected&&!D.has(e.url)&&D.set(e.url,n),e.json()})),n}RequireError.prototype.name=RequireError.name;const Y=ee(async function(e,t){if(e.startsWith(H)&&(e=e.substring(H.length)),/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new RequireError("illegal name");const n=K(e);if(!n)return`${H}${e}`;if(!n.version&&null!=t&&t.startsWith(H)){const e=await Q(K(t.substring(H.length)));n.version=e.dependencies&&e.dependencies[n.name]||e.peerDependencies&&e.peerDependencies[n.name]}if(n.path&&!G.test(n.path)&&(n.path+=".js"),n.path&&n.version&&V.test(n.version))return`${H}${n.name}@${n.version}/${n.path}`;const r=await Q(n);return`${H}${r.name}@${r.version}/${n.path||function(e){for(const t of J){const n=e[t];if("string"==typeof n)return G.test(n)?n:`${n}.js`}}(r)||"index.js"}`});function ee(e){const t=new Map,n=i(null);function r(e){if("string"!=typeof e)return e;let n=t.get(e);return n||t.set(e,n=new Promise((t,n)=>{const r=document.createElement("script");r.onload=(()=>{try{t(F.pop()(i(e)))}catch(e){n(new RequireError("invalid module"))}r.remove()}),r.onerror=(()=>{n(new RequireError("unable to load module")),r.remove()}),r.async=!0,r.src=e,window.define=ie,document.head.appendChild(r)})),n}function i(t){return n=>Promise.resolve(e(n,t)).then(r)}function s(e){return arguments.length>1?Promise.all(B.call(arguments,n)).then(te):n(e)}return s.alias=function(t){return ee((n,r)=>n in t&&(r=null,"string"!=typeof(n=t[n]))?n:e(n,r))},s.resolve=e,s}function te(e){const t={};for(const n of e)for(const e in n)W.call(n,e)&&(null==n[e]?Object.defineProperty(t,e,{get:ne(n,e)}):t[e]=n[e]);return t}function ne(e,t){return()=>e[t]}function re(e){return e+""=="exports"}function ie(e,t,n){const r=arguments.length;r<2?(n=e,t=[]):r<3&&(n=t,t="string"==typeof e?[]:e),F.push(I.call(t,re)?e=>{const r={};return Promise.all(B.call(t,t=>re(t+="")?r:e(t))).then(e=>(n.apply(null,e),r))}:e=>Promise.all(B.call(t,e)).then(e=>"function"==typeof n?n.apply(null,e):n))}function se(e){return null==e?Y:ee(e)}ie.amd={};var oe=p(function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.innerHTML=e.trim(),t},function(){return document.createElementNS("http://www.w3.org/2000/svg","g")}),le=String.raw;function ae(e){return new Promise(function(t,n){var r=document.createElement("link");r.rel="stylesheet",r.href=e,r.onerror=n,r.onload=t,document.head.appendChild(r)})}function ue(e){return function(){return Promise.all([e("@observablehq/katex@0.10.1/dist/katex.min.js"),e.resolve("@observablehq/katex@0.10.1/dist/katex.min.css").then(ae)]).then(function(e){var t=e[0],n=r();function r(e){return function(){var n=document.createElement("div");return t.render(le.apply(String,arguments),n,e),n.removeChild(n.firstChild)}}return n.options=r,n.block=r({displayMode:!0}),n})}}function ce(){return u(function(e){var t=e(document.body.clientWidth);function n(){var n=document.body.clientWidth;n!==t&&e(t=n)}return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}})}e.Library=function(e){const n=se(e);Object.defineProperties(this,{DOM:{value:s,writable:!0,enumerable:!0},Files:{value:o,writable:!0,enumerable:!0},Generators:{value:h,writable:!0,enumerable:!0},html:{value:t(f),writable:!0,enumerable:!0},md:{value:j(n),writable:!0,enumerable:!0},Mutable:{value:t(q),writable:!0,enumerable:!0},now:{value:T,writable:!0,enumerable:!0},Promises:{value:M,writable:!0,enumerable:!0},require:{value:t(n),writable:!0,enumerable:!0},resolve:{value:t(U),writable:!0,enumerable:!0},svg:{value:t(oe),writable:!0,enumerable:!0},tex:{value:ue(n),writable:!0,enumerable:!0},width:{value:ce,writable:!0,enumerable:!0}})},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
// @observablehq/stdlib v3.0.1 Copyright 2019 Observable, Inc. | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.observablehq=e.observablehq||{})}(this,function(e){"use strict";function t(e){return function(){return e}}var n={math:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};var r=0;function i(e){this.id=e,this.href=window.location.href+"#"+e}i.prototype.toString=function(){return"url("+this.href+")"};var s={canvas:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},context2d:function(e,t,n){null==n&&(n=devicePixelRatio);var r=document.createElement("canvas");r.width=e*n,r.height=t*n,r.style.width=e+"px";var i=r.getContext("2d");return i.scale(n,n),i},download:function(e,t="untitled",n="Save"){const r=document.createElement("a"),i=r.appendChild(document.createElement("button"));async function s(){await new Promise(requestAnimationFrame),URL.revokeObjectURL(r.href),r.removeAttribute("href"),i.textContent=n,i.disabled=!1}return i.textContent=n,r.download=t,r.onclick=(async t=>{if(i.disabled=!0,r.href)return s();i.textContent="Saving…";try{const t=await("function"==typeof e?e():e);i.textContent="Download",r.href=URL.createObjectURL(t)}catch(e){i.textContent=n}if(t.eventPhase)return s();i.disabled=!1}),r},element:function(e,t){var r,i=e+="",s=i.indexOf(":");s>=0&&"xmlns"!==(i=e.slice(0,s))&&(e=e.slice(s+1));var o=n.hasOwnProperty(i)?document.createElementNS(n[i],e):document.createElement(e);if(t)for(var l in t)s=(i=l).indexOf(":"),r=t[l],s>=0&&"xmlns"!==(i=l.slice(0,s))&&(l=l.slice(s+1)),n.hasOwnProperty(i)?o.setAttributeNS(n[i],l,r):o.setAttribute(l,r);return o},input:function(e){var t=document.createElement("input");return null!=e&&(t.type=e),t},range:function(e,t,n){1===arguments.length&&(t=e,e=null);var r=document.createElement("input");return r.min=e=null==e?0:+e,r.max=t=null==t?1:+t,r.step=null==n?"any":n=+n,r.type="range",r},select:function(e){var t=document.createElement("select");return Array.prototype.forEach.call(e,function(e){var n=document.createElement("option");n.value=n.textContent=e,t.appendChild(n)}),t},svg:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("viewBox",[0,0,e,t]),n.setAttribute("width",e),n.setAttribute("height",t),n},text:function(e){return document.createTextNode(e)},uid:function(e){return new i("O-"+(null==e?"":e+"-")+ ++r)}};var o={buffer:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)})},text:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsText(e)})},url:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsDataURL(e)})}};function l(){return this}function a(e,t){let n=!1;return{[Symbol.iterator]:l,next:()=>n?{done:!0}:(n=!0,{done:!1,value:e}),return:()=>(n=!0,t(e),{done:!0}),throw:()=>({done:n=!0})}}function u(e){let t,n,r=!1;const i=e(function(e){n?(n(e),n=null):r=!0;return t=e});return{[Symbol.iterator]:l,throw:()=>({done:!0}),return:()=>(null!=i&&i(),{done:!0}),next:function(){return{done:!1,value:r?(r=!1,Promise.resolve(t)):new Promise(e=>n=e)}}}}function h(e){switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files[0];default:return e.value}}var c={disposable:a,filter:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)t(n.value,++r)&&(yield n.value)},input:function(e){return u(function(t){var n=function(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}(e),r=h(e);function i(){t(h(e))}return e.addEventListener(n,i),void 0!==r&&t(r),function(){e.removeEventListener(n,i)}})},map:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)yield t(n.value,++r)},observe:u,queue:function(e){let t;const n=[],r=e(function(e){return n.push(e),t&&(t(n.shift()),t=null),e});return{[Symbol.iterator]:l,throw:()=>({done:!0}),return:()=>(null!=r&&r(),{done:!0}),next:function(){return{done:!1,value:n.length?Promise.resolve(n.shift()):new Promise(e=>t=e)}}}},range:function*(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n));++r<i;)yield e+r*n},valueAt:function(e,t){if(!(!isFinite(t=+t)||t<0||t!=t|0))for(var n,r=-1;!(n=e.next()).done;)if(++r===t)return n.value},worker:function(e){const t=URL.createObjectURL(new Blob([e],{type:"text/javascript"})),n=new Worker(t);return a(n,()=>{n.terminate(),URL.revokeObjectURL(t)})}};function p(e,t){return function(n){var r,i,s,o,l,a,u,h,c=n[0],p=[],f=null,d=-1;for(l=1,a=arguments.length;l<a;++l){if((r=arguments[l])instanceof Node)p[++d]=r,c+="\x3c!--o:"+d+"--\x3e";else if(Array.isArray(r)){for(u=0,h=r.length;u<h;++u)(i=r[u])instanceof Node?(null===f&&(p[++d]=f=document.createDocumentFragment(),c+="\x3c!--o:"+d+"--\x3e"),f.appendChild(i)):(f=null,c+=i);f=null}else c+=r;c+=n[l]}if(f=e(c),++d>0){for(s=new Array(d),o=document.createTreeWalker(f,NodeFilter.SHOW_COMMENT,null,!1);o.nextNode();)i=o.currentNode,/^o:/.test(i.nodeValue)&&(s[+i.nodeValue.slice(2)]=i);for(l=0;l<d;++l)(i=s[l])&&i.parentNode.replaceChild(p[l],i)}return 1===f.childNodes.length?f.removeChild(f.firstChild):11===f.nodeType?((i=t()).appendChild(f),i):f}}var f=p(function(e){var t=document.createElement("template");return t.innerHTML=e.trim(),document.importNode(t.content,!0)},function(){return document.createElement("span")}),d={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:S,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:S,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:S,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};function g(e){this.tokens=[],this.tokens.links={},this.options=e||E.defaults,this.rules=d.normal,this.options.gfm&&(this.options.tables?this.rules=d.tables:this.rules=d.gfm)}d.bullet=/(?:[*+-]|\d+\.)/,d.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,d.item=k(d.item,"gm")(/bull/g,d.bullet)(),d.list=k(d.list)(/bull/g,d.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+d.def.source+")")(),d.blockquote=k(d.blockquote)("def",d.def)(),d._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",d.html=k(d.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,d._tag)(),d.paragraph=k(d.paragraph)("hr",d.hr)("heading",d.heading)("lheading",d.lheading)("blockquote",d.blockquote)("tag","<"+d._tag)("def",d.def)(),d.normal=L({},d),d.gfm=L({},d.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),d.gfm.paragraph=k(d.paragraph)("(?!","(?!"+d.gfm.fences.source.replace("\\1","\\2")+"|"+d.list.source.replace("\\1","\\3")+"|")(),d.tables=L({},d.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),g.rules=d,g.lex=function(e,t){return new g(t).lex(e)},g.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},g.prototype.token=function(e,t,n){var r,i,s,o,l,a,u,h,c;for(e=e.replace(/^ +$/gm,"");e;)if((s=this.rules.newline.exec(e))&&(e=e.substring(s[0].length),s[0].length>1&&this.tokens.push({type:"space"})),s=this.rules.code.exec(e))e=e.substring(s[0].length),s=s[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?s:s.replace(/\n+$/,"")});else if(s=this.rules.fences.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"code",lang:s[2],text:s[3]||""});else if(s=this.rules.heading.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"heading",depth:s[1].length,text:s[2]});else if(t&&(s=this.rules.nptable.exec(e))){for(e=e.substring(s[0].length),a={type:"table",header:s[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:s[3].replace(/\n$/,"").split("\n")},h=0;h<a.align.length;h++)/^ *-+: *$/.test(a.align[h])?a.align[h]="right":/^ *:-+: *$/.test(a.align[h])?a.align[h]="center":/^ *:-+ *$/.test(a.align[h])?a.align[h]="left":a.align[h]=null;for(h=0;h<a.cells.length;h++)a.cells[h]=a.cells[h].split(/ *\| */);this.tokens.push(a)}else if(s=this.rules.lheading.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"heading",depth:"="===s[2]?1:2,text:s[1]});else if(s=this.rules.hr.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"hr"});else if(s=this.rules.blockquote.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"blockquote_start"}),s=s[0].replace(/^ *> ?/gm,""),this.token(s,t,!0),this.tokens.push({type:"blockquote_end"});else if(s=this.rules.list.exec(e)){for(e=e.substring(s[0].length),o=s[2],this.tokens.push({type:"list_start",ordered:o.length>1}),r=!1,c=(s=s[0].match(this.rules.item)).length,h=0;h<c;h++)u=(a=s[h]).length,~(a=a.replace(/^ *([*+-]|\d+\.) +/,"")).indexOf("\n ")&&(u-=a.length,a=this.options.pedantic?a.replace(/^ {1,4}/gm,""):a.replace(new RegExp("^ {1,"+u+"}","gm"),"")),this.options.smartLists&&h!==c-1&&(o===(l=d.bullet.exec(s[h+1])[0])||o.length>1&&l.length>1||(e=s.slice(h+1).join("\n")+e,h=c-1)),i=r||/\n\n(?!\s*$)/.test(a),h!==c-1&&(r="\n"===a.charAt(a.length-1),i||(i=r)),this.tokens.push({type:i?"loose_item_start":"list_item_start"}),this.token(a,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(s=this.rules.html.exec(e))e=e.substring(s[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===s[1]||"script"===s[1]||"style"===s[1]),text:s[0]});else if(!n&&t&&(s=this.rules.def.exec(e)))e=e.substring(s[0].length),this.tokens.links[s[1].toLowerCase()]={href:s[2],title:s[3]};else if(t&&(s=this.rules.table.exec(e))){for(e=e.substring(s[0].length),a={type:"table",header:s[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:s[3].replace(/(?: *\| *)?\n$/,"").split("\n")},h=0;h<a.align.length;h++)/^ *-+: *$/.test(a.align[h])?a.align[h]="right":/^ *:-+: *$/.test(a.align[h])?a.align[h]="center":/^ *:-+ *$/.test(a.align[h])?a.align[h]="left":a.align[h]=null;for(h=0;h<a.cells.length;h++)a.cells[h]=a.cells[h].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(a)}else if(t&&(s=this.rules.paragraph.exec(e)))e=e.substring(s[0].length),this.tokens.push({type:"paragraph",text:"\n"===s[1].charAt(s[1].length-1)?s[1].slice(0,-1):s[1]});else if(s=this.rules.text.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"text",text:s[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var m={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ <>]+(@|:\/)[^ <>]+)>/,url:S,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^<'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)([\s\S]*?[^`])\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:S,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/};function b(e,t){if(this.options=t||E.defaults,this.links=e,this.rules=m.normal,this.renderer=this.options.renderer||new w,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=m.breaks:this.rules=m.gfm:this.options.pedantic&&(this.rules=m.pedantic)}function w(e){this.options=e||{}}function v(e){this.tokens=[],this.token=null,this.options=e||E.defaults,this.options.renderer=this.options.renderer||new w,this.renderer=this.options.renderer,this.renderer.options=this.options}function x(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function k(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=(i=i.source||i).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,i),n):new RegExp(e,t)}}function y(e,t){return $[" "+e]||(/^[^:]+:\/*[^\/]*$/.test(e)?$[" "+e]=e+"/":$[" "+e]=e.replace(/[^\/]*$/,"")),e=$[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^\/]*)[\s\S]*/,"$1")+t:e+t}m._inside=/(?:\[[^\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/,m._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/,m.link=k(m.link)("inside",m._inside)("href",m._href)(),m.reflink=k(m.reflink)("inside",m._inside)(),m.normal=L({},m),m.pedantic=L({},m.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),m.gfm=L({},m.normal,{escape:k(m.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:k(m.text)("]|","~]|")("|","|https?://|")()}),m.breaks=L({},m.gfm,{br:k(m.br)("{2,}","*")(),text:k(m.gfm.text)("{2,}","*")()}),b.rules=m,b.output=function(e,t,n){return new b(t,n).output(e)},b.prototype.output=function(e){for(var t,n,r,i,s="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),s+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=x(":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1])),r=this.mangle("mailto:")+n):r=n=x(i[1]),s+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(i[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),s+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):x(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,s+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){s+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,s+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),s+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),s+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),s+=this.renderer.codespan(x(i[2].trim(),!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),s+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),s+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),s+=this.renderer.text(x(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),r=n=x(i[1]),s+=this.renderer.link(r,null,n);return s},b.prototype.outputLink=function(e,t){var n=x(t.href),r=t.title?x(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,x(e[1]))},b.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},b.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;i<r;i++)t=e.charCodeAt(i),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},w.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+x(t,!0)+'">'+(n?e:x(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:x(e,!0))+"\n</code></pre>"},w.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},w.prototype.html=function(e){return e},w.prototype.heading=function(e,t,n){return"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n"},w.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},w.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"</"+n+">\n"},w.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},w.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},w.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},w.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},w.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},w.prototype.strong=function(e){return"<strong>"+e+"</strong>"},w.prototype.em=function(e){return"<em>"+e+"</em>"},w.prototype.codespan=function(e){return"<code>"+e+"</code>"},w.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},w.prototype.del=function(e){return"<del>"+e+"</del>"},w.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent((i=e,i.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}var i;this.options.baseUrl&&!_.test(e)&&(e=y(this.options.baseUrl,e));var s='<a href="'+e+'"';return t&&(s+=' title="'+t+'"'),s+=">"+n+"</a>"},w.prototype.image=function(e,t,n){this.options.baseUrl&&!_.test(e)&&(e=y(this.options.baseUrl,e));var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},w.prototype.text=function(e){return e},v.parse=function(e,t,n){return new v(t,n).parse(e)},v.prototype.parse=function(e){this.inline=new b(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},v.prototype.next=function(){return this.token=this.tokens.pop()},v.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},v.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},v.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,i="",s="";for(n="",e=0;e<this.token.header.length;e++)({header:!0,align:this.token.align[e]}),n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(i+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",r=0;r<t.length;r++)n+=this.renderer.tablecell(this.inline.output(t[r]),{header:!1,align:this.token.align[r]});s+=this.renderer.tablerow(n)}return this.renderer.table(i,s);case"blockquote_start":for(s="";"blockquote_end"!==this.next().type;)s+=this.tok();return this.renderer.blockquote(s);case"list_start":s="";for(var o=this.token.ordered;"list_end"!==this.next().type;)s+=this.tok();return this.renderer.list(s,o);case"list_item_start":for(s="";"list_item_end"!==this.next().type;)s+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(s);case"loose_item_start":for(s="";"list_item_end"!==this.next().type;)s+=this.tok();return this.renderer.listitem(s);case"html":var l=this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text);return this.renderer.html(l);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}};var $={},_=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function S(){}function L(e){for(var t,n,r=1;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function E(e,t,n){if(n||"function"==typeof t){n||(n=t,t=null);var r,i,s=(t=L({},E.defaults,t||{})).highlight,o=0;try{r=g.lex(e,t)}catch(e){return n(e)}i=r.length;var l=function(e){if(e)return t.highlight=s,n(e);var i;try{i=v.parse(r,t)}catch(t){e=t}return t.highlight=s,e?n(e):n(null,i)};if(!s||s.length<3)return l();if(delete t.highlight,!i)return l();for(;o<r.length;o++)!function(e){"code"!==e.type?--i||l():s(e.text,e.lang,function(t,n){return t?l(t):null==n||n===e.text?--i||l():(e.text=n,e.escaped=!0,void(--i||l()))})}(r[o])}else try{return t&&(t=L({},E.defaults,t)),v.parse(g.lex(e,t),t)}catch(e){if(e.message+="\nPlease report this to https://github.com/chjj/marked.",(t||E.defaults).silent)return"<p>An error occurred:</p><pre>"+x(e.message+"",!0)+"</pre>";throw e}}function P(e){return function(){return p(function(t){var n=document.createElement("div");n.innerHTML=E(t,{langPrefix:""}).trim();var r=n.querySelectorAll("pre code[class]");return r.length>0&&e("@observablehq/highlight.js@1.1.1/highlight.min.js").then(function(e){r.forEach(function(t){e.highlightBlock(t),t.parentNode.classList.add("observablehq--md-pre")})}),n},function(){return document.createElement("div")})}}function A(e){let t;Object.defineProperties(this,{generator:{value:u(e=>void(t=e))},value:{get:()=>e,set:n=>t(e=n)}}),void 0!==e&&t(e)}function*C(){for(;;)yield Date.now()}S.exec=S,E.options=E.setOptions=function(e){return L(E.defaults,e),E},E.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new w,xhtml:!1,baseUrl:null},E.Parser=v,E.parser=v.parse,E.Renderer=w,E.Lexer=g,E.lexer=g.lex,E.InlineLexer=b,E.inlineLexer=b.output,E.parse=E;var q=new Map;function j(e,n){var r;return(r=q.get(e=+e))?r.then(t(n)):(r=Date.now())>=e?Promise.resolve(n):function(e,t){var n=new Promise(function(n){q.delete(t);var r=t-e;if(!(r>0))throw new Error("invalid time");if(r>2147483647)throw new Error("too long to wait");setTimeout(n,r)});return q.set(t,n),n}(r,e).then(t(n))}var O={delay:function(e,t){return new Promise(function(n){setTimeout(function(){n(t)},e)})},tick:function(e,t){return j(Math.ceil((Date.now()+1)/e)*e,t)},when:j};function M(e,t){if(/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new Error("illegal name");return"https://unpkg.com/"+e}const R=new Map,N=[],U=N.map,T=N.some,z=N.hasOwnProperty,D="https://cdn.jsdelivr.net/npm/",F=/^((?:@[^\/@]+\/)?[^\/@]+)(?:@([^\/]+))?(?:\/(.*))?$/,W=/^\d+\.\d+\.\d+(-[\w-.+]+)?$/,I=/\.[^\/]*$/,B=["unpkg","jsdelivr","browser","main"];class RequireError extends Error{constructor(e){super(e)}}function H(e){const t=F.exec(e);return t&&{name:t[1],version:t[2],path:t[3]}}function V(e){const t=`${D}${e.name}${e.version?`@${e.version}`:""}/package.json`;let n=R.get(t);return n||R.set(t,n=fetch(t).then(e=>{if(!e.ok)throw new RequireError("unable to load package.json");return e.redirected&&!R.has(e.url)&&R.set(e.url,n),e.json()})),n}RequireError.prototype.name=RequireError.name;const G=X(async function(e,t){if(e.startsWith(D)&&(e=e.substring(D.length)),/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new RequireError("illegal name");const n=H(e);if(!n)return`${D}${e}`;if(!n.version&&null!=t&&t.startsWith(D)){const e=await V(H(t.substring(D.length)));n.version=e.dependencies&&e.dependencies[n.name]||e.peerDependencies&&e.peerDependencies[n.name]}if(n.path&&!I.test(n.path)&&(n.path+=".js"),n.path&&n.version&&W.test(n.version))return`${D}${n.name}@${n.version}/${n.path}`;const r=await V(n);return`${D}${r.name}@${r.version}/${n.path||function(e){for(const t of B){const n=e[t];if("string"==typeof n)return I.test(n)?n:`${n}.js`}}(r)||"index.js"}`});function X(e){const t=new Map,n=i(null);function r(e){if("string"!=typeof e)return e;let n=t.get(e);return n||t.set(e,n=new Promise((t,n)=>{const r=document.createElement("script");r.onload=(()=>{try{t(N.pop()(i(e)))}catch(e){n(new RequireError("invalid module"))}r.remove()}),r.onerror=(()=>{n(new RequireError("unable to load module")),r.remove()}),r.async=!0,r.src=e,window.define=Y,document.head.appendChild(r)})),n}function i(t){return n=>Promise.resolve(e(n,t)).then(r)}function s(e){return arguments.length>1?Promise.all(U.call(arguments,n)).then(J):n(e)}return s.alias=function(t){return X((n,r)=>n in t&&(r=null,"string"!=typeof(n=t[n]))?n:e(n,r))},s.resolve=e,s}function J(e){const t={};for(const n of e)for(const e in n)z.call(n,e)&&(null==n[e]?Object.defineProperty(t,e,{get:K(n,e)}):t[e]=n[e]);return t}function K(e,t){return()=>e[t]}function Q(e){return e+""=="exports"}function Y(e,t,n){const r=arguments.length;r<2?(n=e,t=[]):r<3&&(n=t,t="string"==typeof e?[]:e),N.push(T.call(t,Q)?e=>{const r={};return Promise.all(U.call(t,t=>Q(t+="")?r:e(t))).then(e=>(n.apply(null,e),r))}:e=>Promise.all(U.call(t,e)).then(e=>"function"==typeof n?n.apply(null,e):n))}function Z(e){return null==e?G:X(e)}Y.amd={};var ee=p(function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.innerHTML=e.trim(),t},function(){return document.createElementNS("http://www.w3.org/2000/svg","g")}),te=String.raw;function ne(e){return new Promise(function(t,n){var r=document.createElement("link");r.rel="stylesheet",r.href=e,r.onerror=n,r.onload=t,document.head.appendChild(r)})}function re(e){return function(){return Promise.all([e("@observablehq/katex@0.10.1/dist/katex.min.js"),e.resolve("@observablehq/katex@0.10.1/dist/katex.min.css").then(ne)]).then(function(e){var t=e[0],n=r();function r(e){return function(){var n=document.createElement("div");return t.render(te.apply(String,arguments),n,e),n.removeChild(n.firstChild)}}return n.options=r,n.block=r({displayMode:!0}),n})}}function ie(){return u(function(e){var t=e(document.body.clientWidth);function n(){var n=document.body.clientWidth;n!==t&&e(t=n)}return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}})}e.Library=function(e){const n=Z(e);Object.defineProperties(this,{DOM:{value:s,writable:!0,enumerable:!0},Files:{value:o,writable:!0,enumerable:!0},Generators:{value:c,writable:!0,enumerable:!0},html:{value:t(f),writable:!0,enumerable:!0},md:{value:P(n),writable:!0,enumerable:!0},Mutable:{value:t(A),writable:!0,enumerable:!0},now:{value:C,writable:!0,enumerable:!0},Promises:{value:O,writable:!0,enumerable:!0},require:{value:t(n),writable:!0,enumerable:!0},resolve:{value:t(M),writable:!0,enumerable:!0},svg:{value:t(ee),writable:!0,enumerable:!0},tex:{value:re(n),writable:!0,enumerable:!0},width:{value:ie,writable:!0,enumerable:!0}})},Object.defineProperty(e,"__esModule",{value:!0})}); |
{ | ||
"name": "@observablehq/stdlib", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"license": "ISC", | ||
@@ -36,3 +36,3 @@ "main": "dist/stdlib.js", | ||
"esm": "^3.0.84", | ||
"marked": "https://github.com/observablehq/marked.git#e9c96e704cc6d8e2bdcbd23484db1ff8b72f03a1" | ||
"marked": "https://github.com/observablehq/marked.git#94c6b946f462fd25db4465d71a6859183f86c57f" | ||
}, | ||
@@ -39,0 +39,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
HTTP dependency
Supply chain riskContains a dependency which resolves to a remote HTTP URL which could be used to inject untrusted code and reduce overall package reliability.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
HTTP dependency
Supply chain riskContains a dependency which resolves to a remote HTTP URL which could be used to inject untrusted code and reduce overall package reliability.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
2
84994
664