From 3f51f35b9f4fd01e5373fc52472e1d1e62e3577f Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Mon, 27 Jul 2020 17:29:58 -0700 Subject: [PATCH] embeds: add automatic reload if serivceWorker is available but controller is not to catch any race condition where serviceWorker has not yet been activated --- package.json | 2 +- src/embed.js | 15 ++++++++++++--- ui.js | 6 +++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index d6a825b..652d8be 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "replaywebpage", "productName": "ReplayWeb.page", - "version": "1.0.2-dev.0", + "version": "1.0.2", "description": "Serverless Web Archive Replay", "repository": "https://github.com/webrecorder/replayweb.page", "homepage": "https://replayweb.page/", diff --git a/src/embed.js b/src/embed.js index f6cbb1e..26d2a1f 100644 --- a/src/embed.js +++ b/src/embed.js @@ -183,13 +183,22 @@ Please try a different browser.\n if (this.injected) { return; } - if (event.target.contentWindow.customElements.get("replay-app-main")) { + const win = event.target.contentWindow; + const doc = event.target.contentDocument; + + if (win.navigator.serviceWorker && !win.navigator.serviceWorker.controller) { + setTimeout(() => window.location.reload(), 100); return; } - const script = event.target.contentDocument.createElement("script"); + + if (win.customElements.get("replay-app-main")) { + return; + } + + const script = doc.createElement("script"); //const script = event.target.contentDocument.querySelector("script"); script.src = scriptSrc; - event.target.contentDocument.head.appendChild(script); + doc.head.appendChild(script); this.injected = true; } } diff --git a/ui.js b/ui.js index d0bbad3..e3dd78d 100644 --- a/ui.js +++ b/ui.js @@ -319,7 +319,7 @@ const ae=new WeakMap,oe=v(e=>t=>{if(!(t instanceof T))throw new Error("unsafeSVG @@ -1461,7 +1461,7 @@ const tt=new WeakMap,it=v(e=>t=>{if(!(t instanceof T))throw new Error("unsafeHTM  About ReplayWeb.page - (${"1.0.2-dev.0"}) + (${"1.0.2"}) `:""} @@ -1681,4 +1681,4 @@ Please try a different browser.\n (Service Workers are disabled in Firefox in Private Mode. If Using Private Mode in Firefox, try regular mode). - `:""}`}onLoad(e){if(this.injected)return;if(e.target.contentWindow.customElements.get("replay-app-main"))return;const t=e.target.contentDocument.createElement("script");t.src=Pt,e.target.contentDocument.head.appendChild(t),this.injected=!0}}!async function(){customElements.define("replay-web-page",Tt)}()},21:function(e,t){const i=/[&<>"']/,a=/[&<>"']/g,o=/[<>"']|&(?!#?\w+;)/,r=/[<>"']|&(?!#?\w+;)/g,n={"&":"&","<":"<",">":">",'"':""","'":"'"},s=e=>n[e];const l=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function c(e){return e.replace(l,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}const d=/(^|[^\[])\^/g;const h=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const b={},u=/^[^:]+:\/*[^/]*$/,p=/^([^:]+:)[\s\S]*$/,m=/^([^:]+:\/*[^/]*)[\s\S]*$/;function g(e,t){b[" "+e]||(u.test(e)?b[" "+e]=e+"/":b[" "+e]=v(e,"/",!0));const i=-1===(e=b[" "+e]).indexOf(":");return"//"===t.substring(0,2)?i?t:e.replace(p,"$1")+t:"/"===t.charAt(0)?i?t:e.replace(m,"$1")+t:e+t}function v(e,t,i){const a=e.length;if(0===a)return"";let o=0;for(;o(a=(a=a.source||a).replace(d,"$1"),e=e.replace(t,a),i),getRegex:()=>new RegExp(e,t)};return i},cleanUrl:function(e,t,i){if(e){let e;try{e=decodeURIComponent(c(i)).replace(h,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!f.test(i)&&(i=g(t,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(e){return null}return i},resolveUrl:g,noopTest:{exec:function(){}},merge:function(e){let t,i,a=1;for(;a{let a=!1,o=t;for(;--o>=0&&"\\"===i[o];)a=!a;return a?"|":" |"}).split(/ \|/);let a=0;if(i.length>t)i.splice(t);else for(;i.length1?{type:"space",raw:t[0]}:{raw:"\n"}}code(e,t){const i=this.rules.block.code.exec(e);if(i){const e=t[t.length-1];if(e&&"paragraph"===e.type)return t.pop(),e.text+="\n"+i[0].trimRight(),e.raw+="\n"+i[0],e;{const e=i[0].replace(/^ {4}/gm,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?e:o(e,"\n")}}}}fences(e){const t=this.rules.block.fences.exec(e);if(t)return{type:"code",raw:t[0],lang:t[2]?t[2].trim():t[2],text:t[3]||""}}heading(e){const t=this.rules.block.heading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}}nptable(e){const t=this.rules.block.nptable.exec(e);if(t){const e={type:"table",header:r(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(e.header.length===e.align.length){let t,i=e.align.length;for(t=0;t ?/gm,"");return{type:"blockquote",raw:t[0],text:e}}}list(e){const t=this.rules.block.list.exec(e);if(t){let e=t[0];const i=t[2],a=i.length>1,o={type:"list",raw:e,ordered:a,start:a?+i:"",loose:!1,items:[]},r=t[0].match(this.rules.block.item);let n,s,l,c,d,h,f,b=!1;const u=r.length;for(let t=0;t1?1===l.length:l.length>1||this.options.smartLists&&l!==i)&&(c=r.slice(t+1).join("\n"),o.raw=o.raw.substring(0,o.raw.length-c.length),t=u-1)),d=b||/\n\n(?!\s*$)/.test(n),t!==u-1&&(b="\n"===n.charAt(n.length-1),d||(d=b)),d&&(o.loose=!0),h=/^\[[ xX]\] /.test(n),f=void 0,h&&(f=" "!==n[1],n=n.replace(/^\[[ xX]\] +/,"")),o.items.push({raw:e,task:h,checked:f,loose:d,text:n});return o}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:this.options.sanitize?"paragraph":"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):n(t[0]):t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:r(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let i,a=e.align.length;for(i=0;i/i.test(a[0])&&(t=!1),!i&&/^<(pre|code|kbd|script)(\s|>)/i.test(a[0])?i=!0:i&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(a[0])&&(i=!1),{type:this.options.sanitize?"text":"html",raw:a[0],inLink:t,inRawBlock:i,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(a[0]):n(a[0]):a[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=s(t[2],"()");if(e>-1){const i=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,i).trim(),t[3]=""}let i=t[2],a="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);e?(i=e[1],a=e[3]):a=""}else a=t[3]?t[3].slice(1,-1):"";return i=i.trim().replace(/^<([\s\S]*)>$/,"$1"),l(t,{href:i?i.replace(this.rules.inline._escapes,"$1"):i,title:a?a.replace(this.rules.inline._escapes,"$1"):a},t[0])}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let e=(i[2]||i[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=i[0].charAt(0);return{type:"text",raw:e,text:e}}return l(i,e,i[0])}}strong(e){const t=this.rules.inline.strong.exec(e);if(t)return{type:"strong",raw:t[0],text:t[4]||t[3]||t[2]||t[1]}}em(e){const t=this.rules.inline.em.exec(e);if(t)return{type:"em",raw:t[0],text:t[6]||t[5]||t[4]||t[3]||t[2]||t[1]}}codespan(e){const t=this.rules.inline.code.exec(e);if(t)return{type:"codespan",raw:t[0],text:n(t[2].trim(),!0)}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[1]}}autolink(e,t){const i=this.rules.inline.autolink.exec(e);if(i){let e,a;return"@"===i[2]?(e=n(this.options.mangle?t(i[1]):i[1]),a="mailto:"+e):(e=n(i[1]),a=e),{type:"link",raw:i[0],text:e,href:a,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let i;if(i=this.rules.inline.url.exec(e)){let e,a;if("@"===i[2])e=n(this.options.mangle?t(i[0]):i[0]),a="mailto:"+e;else{let t;do{t=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0]}while(t!==i[0]);e=n(i[0]),a="www."===i[1]?"http://"+e:e}return{type:"link",raw:i[0],text:e,href:a,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t,i){const a=this.rules.inline.text.exec(e);if(a){let e;return e=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(a[0]):n(a[0]):a[0]:n(this.options.smartypants?i(a[0]):a[0]),{type:"text",raw:a[0],text:e}}}}},63:function(e,t,i){const{defaults:a}=i(20),{cleanUrl:o,escape:r}=i(21);e.exports=class{constructor(e){this.options=e||a}code(e,t,i){const a=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,a);null!=t&&t!==e&&(i=!0,e=t)}return a?'
'+(i?e:r(e,!0))+"
\n":"
"+(i?e:r(e,!0))+"
"}blockquote(e){return"
\n"+e+"
\n"}html(e){return e}heading(e,t,i,a){return this.options.headerIds?"'+e+"\n":""+e+"\n"}hr(){return this.options.xhtml?"
\n":"
\n"}list(e,t,i){const a=t?"ol":"ul";return"<"+a+(t&&1!==i?' start="'+i+'"':"")+">\n"+e+"\n"}listitem(e){return"
  • "+e+"
  • \n"}checkbox(e){return" "}paragraph(e){return"

    "+e+"

    \n"}table(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return"\n"+e+"\n"}tablecell(e,t){const i=t.header?"th":"td";return(t.align?"<"+i+' align="'+t.align+'">':"<"+i+">")+e+"\n"}strong(e){return""+e+""}em(e){return""+e+""}codespan(e){return""+e+""}br(){return this.options.xhtml?"
    ":"
    "}del(e){return""+e+""}link(e,t,i){if(null===(e=o(this.options.sanitize,this.options.baseUrl,e)))return i;let a='",a}image(e,t,i){if(null===(e=o(this.options.sanitize,this.options.baseUrl,e)))return i;let a=''+i+'":">",a}text(e){return e}}},64:function(e,t){e.exports=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,i){return""+i}image(e,t,i){return""+i}br(){return""}}},65:function(e,t){e.exports=class{constructor(){this.seen={}}slug(e){let t=e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t)){const e=t;do{this.seen[e]++,t=e+"-"+this.seen[e]}while(this.seen.hasOwnProperty(t))}return this.seen[t]=0,t}}},8:function(e,t,i){"use strict";const a=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],o=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],r=(e,t)=>{let i=e;return"string"==typeof t?i=e.toLocaleString(t):!0===t&&(i=e.toLocaleString()),i};e.exports=(e,t)=>{if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);const i=(t=Object.assign({bits:!1},t)).bits?o:a;if(t.signed&&0===e)return" 0 "+i[0];const n=e<0,s=n?"-":t.signed?"+":"";if(n&&(e=-e),e<1){return s+r(e,t.locale)+" "+i[0]}const l=Math.min(Math.floor(Math.log10(e)/3),i.length-1);return e=Number((e/Math.pow(1e3,l)).toPrecision(3)),s+r(e,t.locale)+" "+i[l]}},89:function(e,t,i){var a=i(116);e.exports="string"==typeof a?a:a.toString()},90:function(e,t){e.exports=''},91:function(e,t){e.exports=''},92:function(e,t){e.exports=''},93:function(e,t){e.exports=''},94:function(e,t){e.exports=''},95:function(e,t){e.exports=''},96:function(e,t){e.exports=''},97:function(e,t){e.exports=''},98:function(e,t){e.exports=''},99:function(e,t){e.exports=''}})); \ No newline at end of file + `:""}`}onLoad(e){if(this.injected)return;const t=e.target.contentWindow,i=e.target.contentDocument;if(t.navigator.serviceWorker&&!t.navigator.serviceWorker.controller)return void setTimeout(()=>window.location.reload(),100);if(t.customElements.get("replay-app-main"))return;const a=i.createElement("script");a.src=Pt,i.head.appendChild(a),this.injected=!0}}!async function(){customElements.define("replay-web-page",Tt)}()},21:function(e,t){const i=/[&<>"']/,a=/[&<>"']/g,o=/[<>"']|&(?!#?\w+;)/,r=/[<>"']|&(?!#?\w+;)/g,n={"&":"&","<":"<",">":">",'"':""","'":"'"},s=e=>n[e];const l=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function c(e){return e.replace(l,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}const d=/(^|[^\[])\^/g;const h=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const b={},u=/^[^:]+:\/*[^/]*$/,p=/^([^:]+:)[\s\S]*$/,m=/^([^:]+:\/*[^/]*)[\s\S]*$/;function g(e,t){b[" "+e]||(u.test(e)?b[" "+e]=e+"/":b[" "+e]=v(e,"/",!0));const i=-1===(e=b[" "+e]).indexOf(":");return"//"===t.substring(0,2)?i?t:e.replace(p,"$1")+t:"/"===t.charAt(0)?i?t:e.replace(m,"$1")+t:e+t}function v(e,t,i){const a=e.length;if(0===a)return"";let o=0;for(;o(a=(a=a.source||a).replace(d,"$1"),e=e.replace(t,a),i),getRegex:()=>new RegExp(e,t)};return i},cleanUrl:function(e,t,i){if(e){let e;try{e=decodeURIComponent(c(i)).replace(h,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!f.test(i)&&(i=g(t,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(e){return null}return i},resolveUrl:g,noopTest:{exec:function(){}},merge:function(e){let t,i,a=1;for(;a{let a=!1,o=t;for(;--o>=0&&"\\"===i[o];)a=!a;return a?"|":" |"}).split(/ \|/);let a=0;if(i.length>t)i.splice(t);else for(;i.length1?{type:"space",raw:t[0]}:{raw:"\n"}}code(e,t){const i=this.rules.block.code.exec(e);if(i){const e=t[t.length-1];if(e&&"paragraph"===e.type)return t.pop(),e.text+="\n"+i[0].trimRight(),e.raw+="\n"+i[0],e;{const e=i[0].replace(/^ {4}/gm,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?e:o(e,"\n")}}}}fences(e){const t=this.rules.block.fences.exec(e);if(t)return{type:"code",raw:t[0],lang:t[2]?t[2].trim():t[2],text:t[3]||""}}heading(e){const t=this.rules.block.heading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}}nptable(e){const t=this.rules.block.nptable.exec(e);if(t){const e={type:"table",header:r(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(e.header.length===e.align.length){let t,i=e.align.length;for(t=0;t ?/gm,"");return{type:"blockquote",raw:t[0],text:e}}}list(e){const t=this.rules.block.list.exec(e);if(t){let e=t[0];const i=t[2],a=i.length>1,o={type:"list",raw:e,ordered:a,start:a?+i:"",loose:!1,items:[]},r=t[0].match(this.rules.block.item);let n,s,l,c,d,h,f,b=!1;const u=r.length;for(let t=0;t1?1===l.length:l.length>1||this.options.smartLists&&l!==i)&&(c=r.slice(t+1).join("\n"),o.raw=o.raw.substring(0,o.raw.length-c.length),t=u-1)),d=b||/\n\n(?!\s*$)/.test(n),t!==u-1&&(b="\n"===n.charAt(n.length-1),d||(d=b)),d&&(o.loose=!0),h=/^\[[ xX]\] /.test(n),f=void 0,h&&(f=" "!==n[1],n=n.replace(/^\[[ xX]\] +/,"")),o.items.push({raw:e,task:h,checked:f,loose:d,text:n});return o}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:this.options.sanitize?"paragraph":"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):n(t[0]):t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:r(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let i,a=e.align.length;for(i=0;i/i.test(a[0])&&(t=!1),!i&&/^<(pre|code|kbd|script)(\s|>)/i.test(a[0])?i=!0:i&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(a[0])&&(i=!1),{type:this.options.sanitize?"text":"html",raw:a[0],inLink:t,inRawBlock:i,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(a[0]):n(a[0]):a[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=s(t[2],"()");if(e>-1){const i=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,i).trim(),t[3]=""}let i=t[2],a="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);e?(i=e[1],a=e[3]):a=""}else a=t[3]?t[3].slice(1,-1):"";return i=i.trim().replace(/^<([\s\S]*)>$/,"$1"),l(t,{href:i?i.replace(this.rules.inline._escapes,"$1"):i,title:a?a.replace(this.rules.inline._escapes,"$1"):a},t[0])}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let e=(i[2]||i[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=i[0].charAt(0);return{type:"text",raw:e,text:e}}return l(i,e,i[0])}}strong(e){const t=this.rules.inline.strong.exec(e);if(t)return{type:"strong",raw:t[0],text:t[4]||t[3]||t[2]||t[1]}}em(e){const t=this.rules.inline.em.exec(e);if(t)return{type:"em",raw:t[0],text:t[6]||t[5]||t[4]||t[3]||t[2]||t[1]}}codespan(e){const t=this.rules.inline.code.exec(e);if(t)return{type:"codespan",raw:t[0],text:n(t[2].trim(),!0)}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[1]}}autolink(e,t){const i=this.rules.inline.autolink.exec(e);if(i){let e,a;return"@"===i[2]?(e=n(this.options.mangle?t(i[1]):i[1]),a="mailto:"+e):(e=n(i[1]),a=e),{type:"link",raw:i[0],text:e,href:a,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let i;if(i=this.rules.inline.url.exec(e)){let e,a;if("@"===i[2])e=n(this.options.mangle?t(i[0]):i[0]),a="mailto:"+e;else{let t;do{t=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0]}while(t!==i[0]);e=n(i[0]),a="www."===i[1]?"http://"+e:e}return{type:"link",raw:i[0],text:e,href:a,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t,i){const a=this.rules.inline.text.exec(e);if(a){let e;return e=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(a[0]):n(a[0]):a[0]:n(this.options.smartypants?i(a[0]):a[0]),{type:"text",raw:a[0],text:e}}}}},63:function(e,t,i){const{defaults:a}=i(20),{cleanUrl:o,escape:r}=i(21);e.exports=class{constructor(e){this.options=e||a}code(e,t,i){const a=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,a);null!=t&&t!==e&&(i=!0,e=t)}return a?'
    '+(i?e:r(e,!0))+"
    \n":"
    "+(i?e:r(e,!0))+"
    "}blockquote(e){return"
    \n"+e+"
    \n"}html(e){return e}heading(e,t,i,a){return this.options.headerIds?"'+e+"\n":""+e+"\n"}hr(){return this.options.xhtml?"
    \n":"
    \n"}list(e,t,i){const a=t?"ol":"ul";return"<"+a+(t&&1!==i?' start="'+i+'"':"")+">\n"+e+"\n"}listitem(e){return"
  • "+e+"
  • \n"}checkbox(e){return" "}paragraph(e){return"

    "+e+"

    \n"}table(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return"\n"+e+"\n"}tablecell(e,t){const i=t.header?"th":"td";return(t.align?"<"+i+' align="'+t.align+'">':"<"+i+">")+e+"\n"}strong(e){return""+e+""}em(e){return""+e+""}codespan(e){return""+e+""}br(){return this.options.xhtml?"
    ":"
    "}del(e){return""+e+""}link(e,t,i){if(null===(e=o(this.options.sanitize,this.options.baseUrl,e)))return i;let a='
    ",a}image(e,t,i){if(null===(e=o(this.options.sanitize,this.options.baseUrl,e)))return i;let a=''+i+'":">",a}text(e){return e}}},64:function(e,t){e.exports=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,i){return""+i}image(e,t,i){return""+i}br(){return""}}},65:function(e,t){e.exports=class{constructor(){this.seen={}}slug(e){let t=e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t)){const e=t;do{this.seen[e]++,t=e+"-"+this.seen[e]}while(this.seen.hasOwnProperty(t))}return this.seen[t]=0,t}}},8:function(e,t,i){"use strict";const a=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],o=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],r=(e,t)=>{let i=e;return"string"==typeof t?i=e.toLocaleString(t):!0===t&&(i=e.toLocaleString()),i};e.exports=(e,t)=>{if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);const i=(t=Object.assign({bits:!1},t)).bits?o:a;if(t.signed&&0===e)return" 0 "+i[0];const n=e<0,s=n?"-":t.signed?"+":"";if(n&&(e=-e),e<1){return s+r(e,t.locale)+" "+i[0]}const l=Math.min(Math.floor(Math.log10(e)/3),i.length-1);return e=Number((e/Math.pow(1e3,l)).toPrecision(3)),s+r(e,t.locale)+" "+i[l]}},89:function(e,t,i){var a=i(116);e.exports="string"==typeof a?a:a.toString()},90:function(e,t){e.exports=''},91:function(e,t){e.exports=''},92:function(e,t){e.exports=''},93:function(e,t){e.exports=''},94:function(e,t){e.exports=''},95:function(e,t){e.exports=''},96:function(e,t){e.exports=''},97:function(e,t){e.exports=''},98:function(e,t){e.exports=''},99:function(e,t){e.exports=''}})); \ No newline at end of file